Table of Contents
This page extends the information from the "Building container images" page.
Connect to the builder VM:
export BUILD_USER="builder"
export BUILD_HOST="builder.example.net"
ssh "${BUILD_USER}@${BUILD_HOST}"
If the VM is running low on free storage space, remove the latest images (specifically the images themselves, not just the image tags):
df -h # Check disk usage
docker image ls
# Multiple image ids (or "imagename:imagetag" strings) can be supplied at the same time
docker image rm exampleimageid1 exampleimageid2 exampleimageid3 […]
# e. g. with IMAGE_IDs:
docker image rm ba53dde63be9 9a9381a088dd b5040966bef3 cc2f61dbdae0 […]
# Prune docker build cache
docker buildx prune
Create a backup of the old/existing reseed directory (to allow going back to the old state if necessary):
cp -a reseed reseed_InsertTagOfTheOldImageHere
# ⚠️ The directory inside which the new images are build MUST be named "reseed",
# ⚠️ otherwise the names of the container images created won't match!
cd reseed
git pull
# !Optional! - Apply custom changes - Usually not mandatory
git apply example/path/to/example_changes.patch
Update hyrax/deploy_info.json
and generate docker image tag string
./hyrax/deploy_info.sh
export DOCKER_IMAGE_TAG="$(git describe --all --always --long --tags | sed -e 's|^heads/||' -e 's|/|_|g')_$(jq -r '.last_deployed' < hyrax/deploy_info.json | sed 's|\+00:00$|UTC|g;s|:|-|g')"
# Check the docker image tag
echo "${DOCKER_IMAGE_TAG}"
Build the container images
# --no-cache prevents docker from using cached files and
# forces it to freshly pull the latest dependencies
docker compose -f docker-compose.yml build --pull --no-cache
Tag the latest
container images with the corresponding ${DOCKER_IMAGE_TAG} before exporting them
docker image tag "reseed-app:latest" "reseed-app:${DOCKER_IMAGE_TAG}"
docker image tag "reseed-web:latest" "reseed-web:${DOCKER_IMAGE_TAG}"
docker image tag "reseed-workers:latest" "reseed-workers:${DOCKER_IMAGE_TAG}"
ℹ Tagging the latest
images on the builder VM with the corresponding ${DOCKER_IMAGE_TAG}, otherwise the transfer will fail.
⚠️ Make sure to prune the build cache again after building the images to prevent the filesystem from running out of space (the build process can easily cache GBs of storage space each time the images are built):
# Prune docker build cache
docker buildx prune
Transfer the container images to the desired ReSeeD / docker host as described on the "Transferring Images" page.