sysbox
sysbox copied to clipboard
Odd behavior with Docker BuildKit
I'm not sure what's going on, but I am seeing odd behavior when building Docker images with Buildkit when the build context. For example, if I specify ../ as my context COPY commands seem to ignore the context, saying the files don't exist. And in other cases, it might say my Dockerfile doesn't exist at the specified path even though it definitely does exist at that path.
Steps to reproduce:
- Create aGitHub Actions Runner in K8s running on a Sysbox node (you can probably just run any docker-enabled container on a Sysbox node but I have not verified that)
- Run these commands:
mkdir -p deleteme
mkdir -p deleteme/nested
echo 'FROM busybox' > deleteme/Dockerfile
cd deleteme/nested
DOCKER_BUILDKIT=1 docker build -f ../Dockerfile ../../
You will see an error like
failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount889775149/Dockerfile: no such file or directory
If you instead run these commands on a similar pod without Sysbox, it works fine. Or if you, for example, disable Buildkit or change the Dockerfile path to be an absolute path on a pod using Sysbox, things will work fine.
Original mention in Github ARC issue: https://github.com/actions/actions-runner-controller/discussions/977#discussioncomment-4793430
Hi @mike-chen-samsung, thanks for trying Sysbox and sorry for the delayed reply.
Let me try to repro and I'll get back to you soon.
Cause might be the same as for my bug as well - doesn't work with BuildKit, works without: https://github.com/nestybox/sysbox/issues/597