I trying to included an SSL certificate for the first time.
I am trying to run it but not finding the certificate files.
docker run -d -p 443:443 -v e:\data\wordle:/src -v "E:\certificates\www.dworkinsworkshop.net\letsencrypt\live\www.dworkinsworkshop.net\fullchain.pem:/app/fullchain.pem" -v "E:\certificates\www.dworkinsworkshop.net\letsencrypt\live\www.dworkinsworkshop.net\privkey.pem:/app/ rivkey.pem" my-app
docker: Error response from daemon: CreateFile E:\certificates\www.dworkinsworkshop.net\letsencrypt\live\www.dworkinsworkshop.net\fullchain.pem: The file cannot be accessed by the system.
See 'docker run --help'.
Looking for pointers on what I have misunderstood.
Gave it a try and no dffference. (I didn’t expect there to be)
I shoud note some configuration here.
This is running on a windows 10 system in WSL mode.
Ok. finally figured it out. An error on my part when trying to specify the -v paths. I misunderstood them. I have avoided them altogether and just copy the files into my container in my Dockerfile.
The other issue is that the when I ran the certbot and wrote the files to windows file system, they were always zero length.
I had it write the files to the certbot container and then I copied them out.
Success!!!
The behavior of host folder binds depends on whether you bind a single file or a folder:
single file: the file must exist on the host and already has the required content. The container can read the file as is, changes to the file will not reflect back to the file on the host.
folder: the container can create, update delete files in the folder; changes inside the container folder will be reflected back to the folder on the host.
By any chance, did you bind specific files instead of a folder when you created the files with certbot? It would at least explain why the files didn’t have the expected content.
Note: since it became obvious that you use Docker Desktop for Windows, I changed the category of your topic to Docker Desktop and added the Windows tag → now it’s in the right category and has the correct tag.