1

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 :(

Rodriguez David
  • 541
  • 9
  • 25
  • 1
    Try to move your certs to another opened folder and mount it inside (`-v` flag)... It still can be permission issues – SatanDmytro Dec 11 '17 at 12:13
  • I tried to copy the entire folder without success.. then I tried to copy file by file into another folder and this time I find my files inside my container :) ! Is there another way or I will always have to move my .pem files away from there?? – Rodriguez David Dec 11 '17 at 12:28
  • Hope this helps: https://stackoverflow.com/questions/34504156/docker-volume-not-mounting-any-files – Anand Dec 11 '17 at 14:39

1 Answers1

1

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.

enter image description here

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

Volumes docs

Bind Mount docs

Adam
  • 3,992
  • 2
  • 19
  • 39