Description
If I create a volume that references a remote share - e.g. CIFS - by hostname or FQDN, the create step works fine, but when I try to start a container that references the volume, it fails to start, complaining 'no route to host' for the CIFS mount. Referencing the share by IP address works.
If I run the same container without referencing the failing volume, inside the container I can ping the CIFS server by name and by FQDN perfectly well.
I have tried the '--opt o=addr=' method and that returns 'addr: invalid argument'.
The host OS is Ubuntu 22.10 (it's running as a privileged LXC to facilitate sharing an Intel iGPU, not that that should matter!); the host system can mount the same shares just fine.
Reproduce
Create volume for CIFS share:
root@dock:/home/netadmin# docker volume create --driver local --opt type=cifs \
--opt "o=addr=dougal.mydomain.net,username=_backup,password=******" \
--opt device=//dougal/TransferTemp ttt
root@dock:/home/netadmin# docker volume inspect ttt
[
{
"CreatedAt": "2023-08-09T14:13:17Z",
"Driver": "local",
"Labels": null,
"Mountpoint": "/var/lib/docker/volumes/ttt/_data",
"Name": "ttt",
"Options": {
"device": "//dougal/TransferTemp",
"o": "addr=dougal.mydomain.net",
"type": "cifs"
},
"Scope": "local"
}
]
Start container, referencing that volume:
root@dock:/home/netadmin# docker run -it --rm -v ttt:/test busybox sh
docker: Error response from daemon: error while mounting volume '/var/lib/docker/volumes/ttt/_data': failed to mount local volume: mount //dougal/TransferTemp:/var/lib/docker/volumes/ttt/_data, data: **addr=192.168.11.22: invalid argument**.
Further checks:
root@dock:/home/netadmin# nslookup dougal.mydomain.net
Server: 192.168.11.1
Address: 192.168.11.1#53
Non-authoritative answer:
Name: dougal.mydomain.net
Address: 192.168.11.22
root@dock:/home/netadmin# smbclient -L dougal.mydomain.net
Password for [WORKGROUP\root]:
Anonymous login successful
Sharename Type Comment
--------- ---- -------
TransferTemp Disk
RemoteBackup Disk
If I omit the 'addr' option, the response from the mount command is different: 'no route to host'.
Expected behavior
Ideally, all that should be needed is the UNC path for the share, no other options; that's all that the OS mount command needs. The container and the host both have DNS that can resolve the hostname or FQDN.
However, any method that enables mounting CIFS volumes by DNS name will help! ;-)
docker version
Client: Docker Engine - Community
Version: 24.0.5
API version: 1.43
Go version: go1.20.6
Git commit: ced0996
Built: Fri Jul 21 20:35:24 2023
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 24.0.5
API version: 1.43 (minimum version 1.12)
Go version: go1.20.6
Git commit: a61e2b4
Built: Fri Jul 21 20:35:24 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.21
GitCommit: 3dce8eb055cbb6872793272b4f20ed16117344f8
runc:
Version: 1.1.7
GitCommit: v1.1.7-0-g860f061
docker-init:
Version: 0.19.0
GitCommit: de40ad0
docker info
Client: Docker Engine - Community
Version: 24.0.5
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.11.2
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.20.2
Path: /usr/libexec/docker/cli-plugins/docker-compose
Server:
Containers: 4
Running: 3
Paused: 0
Stopped: 1
Images: 6
Server Version: 24.0.5
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 3dce8eb055cbb6872793272b4f20ed16117344f8
runc version: v1.1.7-0-g860f061
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: builtin
cgroupns
Kernel Version: 5.15.107-2-pve
Operating System: Ubuntu 22.10
OSType: linux
Architecture: x86_64
CPUs: 6
Total Memory: 16GiB
Name: dock
ID: 09e14fad-905a-4027-8cfd-231e4ceb94b0
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Additional Info
The underlying OS can mount the CIFS shares just fine and needs only the UNC path:
root@dock:/home/netadmin# mount -t cifs //dougal.mydomain.net/TransferTemp /tmp/test -o "username=_backup,password=******"
root@dock:/home/netadmin# ls /tmp/test
Documents.tar
E18905_PRIME_B560M-A_v2_UM_WEB.pdf
Map-of-Europe-Political.pdf
PXL_20211218_100440101.jpg
PXL_20211218_100445210.jpg
PXL_20211218_100456081.jpg
Description
If I create a volume that references a remote share - e.g. CIFS - by hostname or FQDN, the create step works fine, but when I try to start a container that references the volume, it fails to start, complaining 'no route to host' for the CIFS mount. Referencing the share by IP address works.
If I run the same container without referencing the failing volume, inside the container I can ping the CIFS server by name and by FQDN perfectly well.
I have tried the '--opt o=addr=' method and that returns 'addr: invalid argument'.
The host OS is Ubuntu 22.10 (it's running as a privileged LXC to facilitate sharing an Intel iGPU, not that that should matter!); the host system can mount the same shares just fine.
Reproduce
Create volume for CIFS share:
Start container, referencing that volume:
Further checks:
If I omit the 'addr' option, the response from the mount command is different: 'no route to host'.
Expected behavior
Ideally, all that should be needed is the UNC path for the share, no other options; that's all that the OS mount command needs. The container and the host both have DNS that can resolve the hostname or FQDN.
However, any method that enables mounting CIFS volumes by DNS name will help! ;-)
docker version
docker info
Additional Info
The underlying OS can mount the CIFS shares just fine and needs only the UNC path: