Docker 忽略入口点
Docker ignores ENTRYPOINT
有一些奇怪的错误运行以下docker命令:
docker run -d \
--network="etcd" \
--ip 172.28.0.4 \
-v $(pwd)/etcd01:/etc/ssl/certs \
-p 4001:4001 -p 2380:2380 -p 2379:2379 \
--hostname etcd01 \
--name etcd01 quay.io/coreos/etcd:latest \
-name etcd01 \
-advertise-client-urls http://172.28.0.4:2379,http://172.28.0.4:4001 \
-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
-initial-advertise-peer-urls http://172.28.0.4:2380 \
-listen-peer-urls http://0.0.0.0:2380 \
-initial-cluster etcd01=http://172.28.0.4:2380,etcd01=http://172.28.0.2:2380,etcd02=http://172.28.0.3:2380 \
-initial-cluster-state new
etcd's Dockerfile. And the docker docs 中定义了一个 ENTRYPOINT 表示图像名称之后的所有内容都作为参数传递给入口点。那为什么不呢?
我收到如下错误:docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"-name\": executable file not found in $PATH".
当然-name
不是命令。它应该是 etcd
.
的第一个参数
覆盖容器命令的问题。要执行此操作,我建议您稍微修改一下命令:
docker run -d \
--network="etcd" \
--ip 172.28.0.4 \
-v $(pwd)/etcd01:/etc/ssl/certs \
-p 4001:4001 -p 2380:2380 -p 2379:2379 \
--hostname etcd01 \
--name etcd01 quay.io/coreos/etcd:latest \
etcd \
-name etcd01 \
-advertise-client-urls http://172.28.0.4:2379,http://172.28.0.4:4001 \
-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
-initial-advertise-peer-urls http://172.28.0.4:2380 \
-listen-peer-urls http://0.0.0.0:2380 \
-initial-cluster etcd01=http://172.28.0.4:2380,etcd01=http://172.28.0.2:2380,etcd02=http://172.28.0.3:2380 \
-initial-cluster-state new
有一些奇怪的错误运行以下docker命令:
docker run -d \
--network="etcd" \
--ip 172.28.0.4 \
-v $(pwd)/etcd01:/etc/ssl/certs \
-p 4001:4001 -p 2380:2380 -p 2379:2379 \
--hostname etcd01 \
--name etcd01 quay.io/coreos/etcd:latest \
-name etcd01 \
-advertise-client-urls http://172.28.0.4:2379,http://172.28.0.4:4001 \
-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
-initial-advertise-peer-urls http://172.28.0.4:2380 \
-listen-peer-urls http://0.0.0.0:2380 \
-initial-cluster etcd01=http://172.28.0.4:2380,etcd01=http://172.28.0.2:2380,etcd02=http://172.28.0.3:2380 \
-initial-cluster-state new
etcd's Dockerfile. And the docker docs 中定义了一个 ENTRYPOINT 表示图像名称之后的所有内容都作为参数传递给入口点。那为什么不呢?
我收到如下错误:docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"-name\": executable file not found in $PATH".
当然-name
不是命令。它应该是 etcd
.
覆盖容器命令的问题。要执行此操作,我建议您稍微修改一下命令:
docker run -d \
--network="etcd" \
--ip 172.28.0.4 \
-v $(pwd)/etcd01:/etc/ssl/certs \
-p 4001:4001 -p 2380:2380 -p 2379:2379 \
--hostname etcd01 \
--name etcd01 quay.io/coreos/etcd:latest \
etcd \
-name etcd01 \
-advertise-client-urls http://172.28.0.4:2379,http://172.28.0.4:4001 \
-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
-initial-advertise-peer-urls http://172.28.0.4:2380 \
-listen-peer-urls http://0.0.0.0:2380 \
-initial-cluster etcd01=http://172.28.0.4:2380,etcd01=http://172.28.0.2:2380,etcd02=http://172.28.0.3:2380 \
-initial-cluster-state new