ERROR: for caddy Cannot start service caddy: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"caddy\": executable file not found in $PATH": unknown
That gives you the latest docker image, but then you COPY the binary from your host machine into the docker image to replace the one that was already there, at build time (I was trying to get you to mount it at runtime but that wasn’t working).
You’ll need to adjust the COPY path to wherever you put that Dockerfile, and update your compose file to do something like build: ./caddy (with the path being the dir where you have the Dockerfile) instead of image: caddy. Then when you docker-compose up -d it should build it by pulling in the binary you have on disk.
Hi,
I wonder what is the proxy config of your caddy instance.
I’m not familiar with docker (especially with caddy) but do you have any file like this ?
Thanks I managed to figure out it was a zombie process of caddy from earlier. How can I pass my environment variables from my Dockerized Caddy? It’s not able to get my certs because it doesn’t have my Cloudflare email and password.
I’m assuming you’re not asking how to pass env vars into Docker, but instead how to set env vars outside of Docker?
Depending on shell and/or distro, you can just set them on the command line before you run Caddy. bash lets you simply run name=value as its own command to set variables in the current session, although you’ll want to export them if you will be running Caddy in the background (i.e. caddy start) - man bash has more info (wayyyy more info, search for the ENVIRONMENT heading).
Have a look at man environ on the command line to learn more, and also man env for a tool you can use to set them inline for a specific process.