简体   繁体   中英

Docker mounts and empty volume

I am running docker on ubuntu server 16.04 and I am running a container trying to mount a volume with my let's encrypt certificates..

I am doing:

docker run  ....  -v /etc/letsencrypt/live/mysite:/certs ....  

on mysite folder I have my .pem files, but inside my container i find the folder certs created but it is empty!! I don't know why it is not mounting the files that are inside mysite folder...

Initially mysite folder had belongs to root but I change ownership to the current user with 'chown'.. I am also running docker run with 'sudo' but it is still not coping my folder.

I have no idea what to do :(

Try the mount flag.

docker run -it \
--mount src=/etc/letsencrypt/live/mysite,target=/certs,type=bind ubuntu

Or move your certs to a named volume.

在此处输入图片说明

You'll have to move your certs into that directory given under "Mountpoint"

Volumes docs

Bind Mount docs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM