gpt4 book ai didi

docker - 在Docker镜像中运行Kibana会产生非根错误

转载 作者:行者123 更新时间:2023-12-02 19:51:17 25 4
gpt4 key购买 nike

我在尝试使用Docker-Compose在Docker中设置ELK stack(v7.6.0)时遇到问题。

Elastic Search&Logstash启动正常,但Kibana立即存在,该容器的docker日志报告:

Kibana should not be run as root.  Use --allow-root to continue.

这些元素的docker-compose看起来像这样:
  elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.6.0
environment:
- discovery.type=single-node
ports:
- 9200:9200
mem_limit: 2gb

kibana:
image: docker.elastic.co/kibana/kibana:7.6.0
environment:
- discovery.type=single-node
ports:
- 5601:5601
depends_on:
- elasticsearch

logstash:
image: docker.elastic.co/logstash/logstash:7.6.0
ports:
- "5000:5000/tcp"
- "5000:5000/udp"
- "9600:9600"
mem_limit: 2gb
depends_on:
- elasticsearch

如何禁用以root用户身份运行错误或将应用程序设置为不以root用户身份运行?

最佳答案

我刚刚运行了这个docker镜像,并且一切正常,我共享了docker-compose文件:

version: '3.7'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.6.0
container_name: elasticsearch
environment:
- node.name=node
- cluster.name=elasticsearch-default
- bootstrap.memory_lock=true
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
ports:
- "9200:9200"
expose:
- "9200"
networks:
- "esnet"

kibana:
image: docker.elastic.co/kibana/kibana:7.6.0
container_name: kibana
ports:
- "5601:5601"
expose:
- "5601"
networks:
- "esnet"
depends_on:
- elasticsearch

logstash:
image: docker.elastic.co/logstash/logstash:7.6.0
ports:
- "5000:5000/tcp"
- "5000:5000/udp"
- "9600:9600
depends_on:
- elasticsearch
networks:
- "esnet"
networks:
esnet:

关于docker - 在Docker镜像中运行Kibana会产生非根错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60558206/

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