Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build fails to mount a single file #8114

Open
RocketJas opened this issue Feb 27, 2024 · 3 comments
Open

Docker build fails to mount a single file #8114

RocketJas opened this issue Feb 27, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@RocketJas
Copy link

RocketJas commented Feb 27, 2024

There is an issue with the version of docker on the latest AzureLinux container image

Docker build failing to mount single file via bind
When running docker build (with DOCKER_BUILDKIT=1) on the mariner image, the RUN stage fails when attempting to mount a single file --mount=type=bind with the error

executor failed running [/bin/bash -euxc bash tmp/test_mount.sh]: failed to mount /var/lib/docker/tmp/buildkit-mount3000888503: [{Type:bind Source:/proc/self/fd/25 Options:[rbind ro]}]: not a directory

To Reproduce
Steps to reproduce the behavior:

  1. Ensure you are running on a mariner OS
  2. Clone repo
  3. Set the Environment Variable export DOCKER_BUILDKIT=1
  4. From the root directory run docker build -t test_dockerfile_mariner -f test.dockerfile .
@RocketJas RocketJas added the bug Something isn't working label Feb 27, 2024
@mattsheerin
Copy link

I hit this too. With the help of dnf history I managed to inspect my recent upgrades.

  • sudo dnf downgrade moby-cli-20.10.27-3.cm2.x86_64 didn't seem to help.
  • sudo dnf downgrade moby-cli-20.10.27-2.cm2.x86_64 still didn't fix it.
  • sudo dnf downgrade moby-engine-20.10.27-1.cm2.x86_64 worked, I think I had to restart docker too. Maybe the above downgrades aren't needed but I'm holding off upgrading again until this is fixed.

@mandeepsplaha
Copy link
Contributor

Hi @RocketJas, the link to the repo doesn't seem valid anymore. Do you still have this issue? I can confirm that some of our builds, we do have --mount=type=bind usage in Mariner and it works successfully. We do install moby-buildx package for this functionality.

@mattsheerin
Copy link

I recently hit a different problem and installed moby-buildx as a solution. Today I tried the problematic build for the first time in a while, this time with all the latest moby RPMs, and still have this issue.

In your builds, do you use --mount=type=bind for files or directories? I seem to only have the problem for mounting individual files, but I've not tested that extensively.

Solution for me is still:

sudo dnf downgrade moby-engine-20.10.27-1.cm2.x86_64
sudo systemctl restart docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants