docker / docker/cli

cifs volume without clean password

Open
#2,802 9 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/question
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Hello,

Description

I want to create a docker volume without having the clear password displayed with docker volume inspect ....

In the man pages of mount.cifs is the option credentials=filename specified and it works in the following example.

mount -v -t cifs \ 
    -o credentials=$HOME/.cifs,addr=SERVER_IP \
    //SERVER_NAME/SHARE $HOME/MOUNTPOINT

But it will not work with an 'docker volume', which I create with:

docker volume create \
    --driver local \
    --opt type=cifs \
    --opt o=addr=SERVER_IP,credentials=$HOME/.cifs \
    --opt device=//SERVER_NAME/SHARE\
    VOLUME_NAME

After an attempt to run a container with that volume, I get an error message.

> docker container run -it --rm \
    --mount type=volume,source=VOLUME_NAME,target=/data/MOUNTPOINT \
    python:3.8-alpine /bin/sh

docker: Error response from daemon: error while mounting volume '/tmp/virt/docker/65536.65536/volumes/VOLUME_NAME/_data': \
failed to mount local volume: mount //SERVER_NAME/SHARE:/tmp/virt/docker/65536.65536/volumes/VOLUME_NAME \_data, \ 
data: addr=SERVER_IP,credentials=/home/USER/.cifs: invalid argument.

Creating a docker volume with specifying username and password the mount succeeds and I can access the data from within the container.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the docker volume create command with type=cifs and credentials=$HOME/.cifs, then run the shown docker container run command and inspect the mount error. Compare this with the working username-and-password configuration. Done means the credentials-file form mounts successfully without exposing the clear password in docker volume inspect.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
cli, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.