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

Read-only file volumes fail on fedora 39 with docker #1421

Closed
fallenwood opened this issue Feb 25, 2024 · 5 comments · Fixed by #1422
Closed

Read-only file volumes fail on fedora 39 with docker #1421

fallenwood opened this issue Feb 25, 2024 · 5 comments · Fixed by #1422

Comments

@fallenwood
Copy link

Environment:

Fedora 39 x64
Docker version 25.0.3, build 4debf41
crun version 1.14.3
  commit: 1961d211ba98f532ea52d2e80f4c20359f241a98
podman version 4.9.0

Repro

create an empty a.sh, run command

→ docker run --rm --runtime crun -v $(pwd)/a.sh:/a.sh:ro registry.docker.com/library/fedora:39 echo "hello"

errors

docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: open mount target `/a.sh`: Not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.

while it works with podman under the same folder

→ podman run --rm --runtime crun -v $(pwd)/a.sh:/a.sh:ro registry.docker.com/library/fedora:39 echo "hello"
hello

and it also works with docker with ro removed

→ docker run --rm --runtime crun -v $(pwd)/a.sh:/a.sh registry.docker.com/library/fedora:39 echo "hello"
hello

Also verified the issue does not exist in ubuntu 23.10 where crun version was 1.8.5

@giuseppe
Copy link
Member

how have you installed Docker 25 on Fedora 39? AFAICS, the version available is moby-engine-24.0.5-1.fc39.x86_64.

it works well on Fedora 39 with moby-engine-24 for me using your same reproducer:

$ touch a.sh
$ docker run --rm --runtime crun -v $(pwd)/a.sh:/a.sh:ro registry.docker.com/library/fedora:39 echo "hello"
hello

Where Moby is configured as following:

# cat /etc/docker/daemon.json 
{
  "runtimes": {
    "crun": {
      "path": "/usr/bin/crun"
    }
  }
}

@fallenwood
Copy link
Author

how have you installed Docker 25 on Fedora 39? AFAICS, the version available is moby-engine-24.0.5-1.fc39.x86_64.

I installed with doc from docker side at https://docs.docker.com/engine/install/fedora, and installed crun with dnf

here is my daemon.json

{
  "default-runtime": "crun",
  "runtimes": {
    "crun": {
      "path": "/usr/bin/crun"
    }
  }
}

@giuseppe
Copy link
Member

can you please please try with the version packaged for Fedora?

@fallenwood
Copy link
Author

fallenwood commented Feb 26, 2024

can you please please try with the version packaged for Fedora?

The packaged version from dnf works

[fedora@localhost ~]$ sudo docker run --rm --runtime crun -v $(pwd)/a.sh:/a.sh:ro registry.docker.com/library/fedora:39 echo "hello"
hello
[fedora@localhost ~]$ docker --version
Docker version 24.0.5, build %{shortcommit_cli}

giuseppe added a commit to giuseppe/crun that referenced this issue Feb 26, 2024
do not assume it is a directory, but check the source type.

Closes: containers#1421

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@giuseppe
Copy link
Member

thanks.

Opened a PR: #1422

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants