cifs volume without clean password
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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