tomdess / docker-haproxy-certbot

Dockerized HAProxy with Let's Encrypt certificates automatic renewal
69 stars 54 forks source link

Problem with mount #7

Closed mozartatplay closed 4 years ago

mozartatplay commented 4 years ago

When running the following suggested command with my CERT domain

docker run --name inethi-haproxyssl -d \ -e CERTS=inethidev.net \ -e EMAIL=test@gmail.com \ -v /srv/letsencrypt:/etc/letsencrypt \ -v /srv/haproxycfg/haproxy.cfg:/etc/haproxy/haproxy.cfg \ --network inethi-bridge \ -p 80:80 -p 443:443 \ tomdess/haproxy-certbot:latest

I get the follow error

docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\"/srv/haproxycfg/haproxy.cfg\\" to rootfs \\"/var/lib/docker/overlay2/5a375659d70bc6c60811936fd8ecd0ed7f78f042d2369d0b049b1e4a5ddceafa/merged\\" at \\"/var/lib/docker/overlay2/5a375659d70bc6c60811936fd8ecd0ed7f78f042d2369d0b049b1e4a5ddceafa/merged/etc/haproxy/haproxy.cfg\\" caused \\"not a directory\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.

Do I need to change something in my mount ... I noticed it created a path /srv/haproxycfg/haproxy.cfg/ where haproxy.cfg was a directory not a file

tomdess commented 4 years ago

you must create the file /srv/haproxycfg/haproxy.cfg before running the "docker run" command

mozartatplay commented 4 years ago

Thanks Tom - silly mistake