Docker撰写运行在入口点引发错误

时间:2019-04-19 08:34:06

标签: docker docker-compose caddy

运行以下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"

有什么想法我会在这里丢失吗?

1 个答案:

答案 0 :(得分:2)

在abiosoft / caddy Dockerfile中,标准入口点为ENTRYPOINT ["/bin/parent", "caddy"]link here)。

因此,我认为您必须在入口点将./caddy更改/bin/parent caddy

我还认为您不必覆盖默认入口点,只需覆盖默认命令(CMD ["--conf", "/etc/Caddyfile", "--log", "stdout", "--agree=$ACME_AGREE"])来指定要传给caddy的args。

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