简体   繁体   English

docker 修改已存在停止容器的启动参数

[英]docker modify start parameters of exist stopped container

I use sudo docker run -p 5601:5601 -p 9200:9200 -p 5044:5044 -it --name elk sebp/elk command to run a elk container, and has populated many data to the container, but it cannot start now.我使用sudo docker run -p 5601:5601 -p 9200:9200 -p 5044:5044 -it --name elk sebp/elk命令来运行一个 elk 容器,并且已经将许多数据填充到容器中,但它现在无法启动.

And I guess it's caused by one service named logstash in the container, so I want to start the container without start the logstash service.而且我猜这是由容器中一个名为logstash的服务引起的,所以我想在不启动logstash服务的情况下启动容器。

There is one parameter -e LOGSTASH_START=0 to make the container not start the service, when create a new container.有一个参数-e LOGSTASH_START=0使容器在创建新容器时不启动服务。

How can I apply it to the exist container?如何将其应用于现有容器? I use windows docker-desktop 4.1.1.我使用 windows docker-desktop 4.1.1。

If you know where the data is kept in the container you can try docker cp elk:/data/path/in/elk/container /target/path/on/host to move it out.如果您知道数据在容器中的保存位置,您可以尝试docker cp elk:/data/path/in/elk/container /target/path/on/host将其移出。

Otherwise you can look here to find the equivalent config.v2.json on Windows;否则,您可以查看此处以在 Windows 上找到等效的 config.v2.json; add the LOGSTASH_START=0 to the "Env" array ( Note no -e required).LOGSTASH_START=0添加到“Env”数组(注意不需要 -e)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 RabbitMQ在Windows Docker容器中启动缓慢 - RabbitMQ is slow to start inside Windows Docker Container Docker 容器在启动后立即关闭 - Docker container closes immediately after start 如何在 windows 启动时自动启动 docker 容器 ~ 等待 docker 运行 - How to automatically start docker container on windows boot ~ Wait for docker to be running Windows上的docker-compose - 找不到容器命令'sh'或不存在 - docker-compose on Windows - Container command 'sh' not found or does not exist wsl 上的 Docker-compose 无法在容器中启动终结器 - Docker-compose on wsl cannot start terminator in container Golang docker 容器无法在 Windows Home 上启动 - Golang docker container doesn't start on Windows Home Docker 服务容器,错误:服务 'w3svc' 已停止 - Docker service container, error : Service 'w3svc' has been stopped Windows PC启动时如何自动启动容器?(Docker快速启动终端,DockerToolbox-19.03.1.exe) - how to Automatically start a container when Windows PC start?(Docker Quickstart Terminal, DockerToolbox-19.03.1.exe) Docker ERROR:从Win10运行时找不到容器命令或不存在容器命令 - Docker ERROR: Container command not found or does not exist when running from Win10 docker 引擎停止 Windows 11 - docker engine stopped windows 11
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM