Commit 4e51ef9e authored by segfault's avatar segfault
Browse files

WIP: Introduce a LATEST file

I'm now unsure if this is a good way to go
parent 8d8f4ac5
BASE_IMAGE=debian:buster
BASE_IMAGE_DIGEST=1092695e843ad975267131f27a2b523128c4e03d2d96574bbdd7cf949ed51475
......@@ -36,16 +36,29 @@ case "$1" in
esac
done
TAG="${TAG:-"tailslive/debian-buster:v1"}"
# Import BASE_IMAGE and BASE_IMAGE_DIGEST
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
source "${SCRIPT_DIR}/LATEST"
# Pull the latest version of the base image
docker pull "${BASE_IMAGE}"
#
TAG="${TAG:-"tailslive/debian-buster:${BASE_IMAGE_DIGEST:0:8}"}"
# Build the image
DOCKER_BUILDKIT=1 docker build \
--cache-from "${TAG}" \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg BASE_IMAGE_DIGEST="${BASE_IMAGE_DIGEST}" \
--tag "${TAG}" \
.
# Push the image (if requested)
if [ -n "${PUSH:-}" ]; then
docker push "${TAG}"
# Update the BASE_IMAGE_DIGEST in the LATEST file
fi
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment