运行以下cmd:docker-compose up -d
引发以下错误:
ERROR: for ubuntu_caddy_1 Cannot start service caddy: oci runtime error: container_linux.go:247: starting container process caused "exec: \"./caddy\": stat ./caddy: no such file or directory"
这是
docker-compose.yml
文件services:
caddy:
image: abiosoft/caddy
ports:
- "80:80"
- "443:443"
- "2015:2015"
volumes:
- "./caddy-data:/root/.caddy"
- "./config:/etc/caddy"
- "./config/Caddyfile:/etc/Caddyfile"
entrypoint:
- ./caddy
- "-conf"
- /etc/Caddyfile
- "-agree"
- "-log=stdout"
- "-port=443"
restart: "on-failure: 10"
user: root
version: "2"
对我在这里想念的东西有任何想法吗?
最佳答案
在abiosoft / caddy Dockerfile中,标准入口点是ENTRYPOINT ["/bin/parent", "caddy"]
(link here)。
因此,我认为您必须通过./caddy
在入口点更改/bin/parent caddy
。
我还认为您不必覆盖默认入口点,只需覆盖默认命令(即CMD ["--conf", "/etc/Caddyfile", "--log", "stdout", "--agree=$ACME_AGREE"]
)即可将args指定给caddy。
因此,您最终得到command: -conf /etc/Caddyfile -agree -log=stdout -port=443
。
关于docker - Docker撰写运行在入口点引发错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/55758929/