Commit dac059e1 authored by Arran Walker's avatar Arran Walker

Fix helper docker image tar output

parent e3d28e8f
......@@ -59,9 +59,23 @@ setup_docker_context
_docker_buildx build \
--platform "${platform}" \
--no-cache \
--output "type=tar,dest=$TARGET_FILE" \
--output "type=docker" \
--tag "gitlab/gitlab-runner-helper:$TARGET_ARCH-$REVISION" \
dockerfiles/runner-helper
# Docker's buildx build --output=tar,dest=$TARGET_FILE produces a mostly valid
# image, but has problems with docker when the aufs filesystem driver is used.
#
# For example, the following, when used with aufs:
# docker run --rm -it <image> touch /root/test
# produces the error:
#  touch: /root/test: Operation not permitted
#
# To correct this, we instead flatten and export a container image. If the aufs
# problem is fixed in the future (we should check again, once buildx is no
# longer considered experimental), we can perhaps remove these redundant steps.
_docker create --name=runner-helper-$TARGET_ARCH-$REVISION "gitlab/gitlab-runner-helper:$TARGET_ARCH-$REVISION"
_docker export -o $TARGET_FILE runner-helper-$TARGET_ARCH-$REVISION
trap - ERR SIGINT SIGTERM
cleanup_docker_context
Markdown is supported
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