gpt4 book ai didi

docker - 在Docker上运行etcd v3时出错

转载 作者:行者123 更新时间:2023-12-02 18:31:47 25 4
gpt4 key购买 nike

当我尝试在Docker上运行etcd(版本3.0.0)时:

sudo docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs -p 4001:4001 -p 2380:2380 -p 2379:2379 \
--name etcd quay.io/coreos/etcd:v3.0.0 \
-name etcd0 \
-advertise-client-urls http://${HostIP}:2379,http://${HostIP}:4001 \
-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
-initial-advertise-peer-urls http://${HostIP}:2380 \
-listen-peer-urls http://0.0.0.0:2380 \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster etcd0=http://${HostIP}:2380 \
-initial-cluster-state new

我有一个错误:
docker: Error response from daemon: invalid header field value "oci runtime error: container_linux.go:247: starting container process caused \"exec: \\\"-name\\\": executable file not found in $PATH\"\n".
此错误的原因是什么,我该如何解决?

最佳答案

如评论中所述,quay.io/coreos/etcd:v3.0.0图像不包含ENTRYPOINT,而是选择CMD。因此,如果要在docker run上提供所有参数,则还需要指定命令:

docker run -p 2379:2379 --name etcd quay.io/coreos/etcd:v3.1.0 \
/usr/local/bin/etcd \
--advertise-client-urls http://0.0.0.0:2379 \
--listen-client-urls http://0.0.0.0:2379 \
--initial-advertise-peer-urls http://0.0.0.0:2380 \
--listen-peer-urls http://0.0.0.0:2380 \
--initial-cluster "default=http://0.0.0.0:2380"

关于docker - 在Docker上运行etcd v3时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41247557/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com