-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
[BUG] mount nfs volume in docker-compose.yml issue #12308
Comments
Your |
compose equivalent would be: (...)
volumes:
- source: ./web/dist
target: /usr/share/nginx/html
volume:
<driver and options> # this is not supported by the spec, seems nobody asked for it 😅 |
Creating the volume using The thing that does not work is creating the volume inside the So what is the catch? |
Update: after having created the volume with It seemed strange to me that now it works in this smaller reproducible case that I provided here, so I tried again on my original problem which was a Immich compose file where the nfs volume is called
So it started without issues and the files are present in
Seems like that if the volume has been created once |
Thanks for this detailed description, I'll try to reproduce and investigate |
I checked |
maybe a race condition ? |
Description
It might be a bug since i cannot find solution online.
Mounting nfs share directly to a container works when using
docker run
but not when using a compose file withdocker compose
.Steps To Reproduce
docker-compose.yml
which mounts a nfs share volume directly in the container:doing
docker compose up -d
gives:Error response from daemon: error while mounting volume '/var/lib/docker/volumes/hello_my_nfs_volume/_data': failed to mount local volume: mount :/immich:/var/lib/docker/volumes/hello_my_nfs_volume/_data, data: addr=192.168.1.100,nolock,soft: permission denied
However, not using the compose file and running directly
docker run -it --name try --mount 'type=volume,source=nfs_try,target=/mnt/nfs,volume-driver=local,volume-opt=type=nfs,"volume-opt=o=addr=192.168.1.100,rw,nfsvers=4.1",volume-opt=device=:/immich' alpine:latest
works fine and i can access the files in the share from the container shell.
Compose Version
Docker Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: