Skip to content

Running a container with a Samba volume specified by a hostname seems to have stop working. #4816

@Gwenn-LR

Description

@Gwenn-LR

Description

Hi,

First of all thanks to your all your team and the community for all the work done and brought to everyone.

I'm using Docker in Docker to run CI steps with Gitlab runner and while the connection to a samba volume was working previously, it seems that the specification of a Samba volume by a hostname as described in your documentation doesn't work anymore.

It used to work smoothly 3 months ago (I have discontinued the CI worflow for a long time) and I've changed the storage volume since, so I was thinking the following error was coming from my side:

docker: Error response from daemon: error while mounting volume '/var/lib/docker/volumes/< VOLUME_NAME >/_data': failed to mount local volume: mount //< SERVER_ADDR >/< DATA_DIR >:/var/lib/docker/volumes/< VOLUME_NAME >/_data, data: addr=< SERVER_HOSTNAME >,username=< USERNAME >,password=*********,file_mode=0777,dir_mode=0777: invalid argument.

However I've finally suceeded to connect my volume directly using the IP address when creating the docker volume so this issue seems to originate from the field addr since the < SERVER_HOSTNAME > < SERVER_ADDR > conversion is correct.

That's why I was wondering if this behaviour was coming from a modification of docker or if I was missing something out.

Reproduce

ISSUE

  1. docker volume create \
    --driver local
    --opt type=cifs
    --opt device="//< SERVER_HOSTNAME >/< DATA_DIR >"
    --opt o="addr=< SERVER_HOSTNAME >,username=< USERNAME >,password=< PASSWORD >,file_mode=0777,dir_mode=0777"
    --name cif_volume
  2. docker run -d -v cif_volume:/data gitlab/gitlab-runner:latest --name test

< CONTAINER_ID >
docker: Error response from daemon: error while mounting volume '/var/lib/docker/volumes/< VOLUME_NAME >/_data': failed to mount local volume: mount //< SERVER_ADDR >/< DATA_DIR >:/var/lib/docker/volumes/< VOLUME_NAME >/_data, data: addr=< SERVER_HOSTNAME >,username=< USERNAME >,password=*********,file_mode=0777,dir_mode=0777: invalid argument.

WORK AROUND

  1. docker volume create \
    --driver local
    --opt type=cifs
    --opt device="//< SERVER_ADDR >/< DATA_DIR >"
    --opt o="username=< USERNAME >,password=< PASSWORD >,file_mode=0777,dir_mode=0777"
    --name cif_volume
  2. docker run -d -v cif_volume:/data gitlab/gitlab-runner:latest --name test

< CONTAINER_ID >

Expected behavior

  • docker run -d -v cif_volume:/data gitlab/gitlab-runner:latest --name test should run without any error when following Docker documentation.
  • An execution of a shell inside the container should allow a user to access data in the docker volume, i.e.:
docker exec -ti test bash
ls /data
> Folder1   Folder2   ...

docker version

Client: Docker Engine - Community
 Version:           25.0.0
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        e758fe5
 Built:             Thu Jan 18 17:09:49 2024
 OS/Arch:           linux/amd64
 Context:           default

docker info

Client: Docker Engine - Community
 Version:    25.0.0
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions