Skip to content

Instantly share code, notes, and snippets.

@kepocnhh
Created May 2, 2026 17:23
Show Gist options
  • Select an option

  • Save kepocnhh/da33b2537621b45a476f806f250225c2 to your computer and use it in GitHub Desktop.

Select an option

Save kepocnhh/da33b2537621b45a476f806f250225c2 to your computer and use it in GitHub Desktop.
test debian
#!/usr/local/bin/bash
ARCH='amd64'
PLATFORM="linux/${ARCH}"
HOST='docker.io'
NAMESPACE='kepocnhh'
ISSUER='debian'
ISSUER_VERSION='trixie'
REPOSITORY="${ISSUER}-${ISSUER_VERSION}-${ARCH}"
IMAGE_VERSION='10'
IMAGE_FLAVOR='a'
IMAGE_TAG="${IMAGE_VERSION}${IMAGE_FLAVOR}"
IMAGE_NAME="${HOST}/${NAMESPACE}/${REPOSITORY}:${IMAGE_TAG}"
if test $? -ne 0; then
echo "Docker build error!"; exit 21; fi
CONTAINER_NAME="container.${REPOSITORY}"
docker stop "${CONTAINER_NAME}"
docker rm -f "${CONTAINER_NAME}"
docker run --platform="${PLATFORM}" \
-id --name "${CONTAINER_NAME}" "${IMAGE_NAME}"
if test $? -ne 0; then
echo 'Run error!'; exit 1; fi
docker exec -it "${CONTAINER_NAME}" '/usr/local/bin/bash'
docker stop "${CONTAINER_NAME}"
docker rm -f "${CONTAINER_NAME}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment