The file cannot be accessed by the system

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.

My apologies, this may not help at all. Are the paths case sensitive? Are E and e the same drive?

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.

Something is not adding up here.

Please share the output of docker info. Make sure to wrapp the response in a code block for better readability.

C:\Users\groot>docker info
Client:
 Version:    26.1.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.14.0-desktop.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.27.0-desktop.2
    Path:     C:\Program Files\Docker\cli-plugins\docker-compose.exe
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.29
    Path:     C:\Program Files\Docker\cli-plugins\docker-debug.exe
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     C:\Program Files\Docker\cli-plugins\docker-dev.exe
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.23
    Path:     C:\Program Files\Docker\cli-plugins\docker-extension.exe
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.4
    Path:     C:\Program Files\Docker\cli-plugins\docker-feedback.exe
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.1.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-init.exe
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-sbom.exe
  scout: Docker Scout (Docker Inc.)
    Version:  v1.8.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-scout.exe

Server:
 Containers: 5
  Running: 2
  Paused: 0
  Stopped: 3
 Images: 33
 Server Version: 26.1.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: e377cd56a71523140ca6ae87e30244719194a521
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
 Kernel Version: 5.15.133.1-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 62.77GiB
 Name: docker-desktop
 ID: 6478fd6d-eb97-4f9b-b555-0a67235b6ac1
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Labels:
  com.docker.desktop.address=npipe://\\.\pipe\docker_cli
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
WARNING: daemon is not using the default seccomp profile

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.