Docker compose 运行 在入口点抛出错误

Docker compose run throws error on entrypoint

运行 以下命令:

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"])将您的参数指定给 caddy。

所以你最终得到 command: -conf /etc/Caddyfile -agree -log=stdout -port=443