agent: Dockerfile test

This commit is contained in:
2025-08-25 11:31:11 +01:00
parent 2f644336f5
commit 136d80bd71
3 changed files with 66 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ set -euo pipefail
#
IMAGE=${IMAGE:-"andrejusk/dotfiles"}
DOCKERFILE=${DOCKERFILE:-Dockerfile}
uuid=$(
uuidgen 2> /dev/null \
|| cat /proc/sys/kernel/random/uuid 2> /dev/null \
@@ -14,13 +15,14 @@ uuid=$(
)
tag=${TAG:-"$uuid"}
echo "Building $IMAGE:$tag"
echo "Building $IMAGE:$tag using $DOCKERFILE"
docker build . \
--build-arg UUID=$uuid \
--cache-from $IMAGE \
--tag $IMAGE:$tag \
--target test
--target test \
-f "$DOCKERFILE"
docker run \
-v "$(pwd)"/logs:/home/test-user/.dotfiles/logs \