sysbox icon indicating copy to clipboard operation
sysbox copied to clipboard

Odd behavior with Docker BuildKit

Open mike-chen-samsung opened this issue 2 years ago • 2 comments

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:

  1. 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)
  2. 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

mike-chen-samsung avatar Apr 12 '23 18:04 mike-chen-samsung

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.

ctalledo avatar Apr 18 '23 22:04 ctalledo

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

XVilka avatar Aug 27 '23 02:08 XVilka