0

我正在尝试使用 Docker SDK 从 Python 运行 Docker 容器,但它总是失败并出现以下错误: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] Web 上的表单搜索我发现我需要将发现类型更改为单节点,我该如何添加它?

import docker
client = docker.from_env()
port = {'9200/tcp':'9200','9300/tcp':'9300'}
container = client.containers.run("docker.elastic.co/elasticsearch/elasticsearch:7.10.1",ports=port)
4

1 回答 1

0

我通过添加环境标志来运行函数调用来解决这个问题

环境 = {“discovery.type”=“单节点”}

于 2021-01-06T16:11:13.733 回答