In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
How to repair the docker container, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
How do I fix the docker container? For example, change the daemon in the php-fpm configuration file in the container to yes, resulting in no foreground process, so the container stops when it starts. So how do you modify files in containers that are not started?
Create a new mirror
Submit the problem container to a new image using docker commit, and then use docker run-it to run a new container to change (repair) the configuration file based on the new image. Then submit a new image through the new container, and then restart the container based on the new image (same as the original container).
This approach is feasible, but the problem is that there are many steps and new images are submitted, adding complexity to subsequent maintenance.
# submit the container to be repaired as docker commit: docker rm # delete the old container, but you can't use it anyway # View the newly created image REPOSITORY TAG IMAGE ID CREATED SIZEzhibin/php5 2018 c6532c5ece91 10 minutes ago 1.549 GB# use this new image to create the container and enter the container Repair the configuration file docker run-it-- name tmp-fixphp5 zhibin/php5:2018 / bin/bash# resubmit the image docker commit: # create the repaired container docker run-d-- volumes-from nginx_server-- name php-fpm_server_2018-- dns=10.100.17.21-- cap-add SYS_PTRACE-p 9000 zhibin/php5:201802
Or in the process of using Docker, when running docker-compose up or docker run, Conflict. The name W is already in use by container XYZ. You have to delete.. Or "Conflict, cannot remove the default name of the container..."
We cannot start the container because the name is already in use. Run the docker ps command and you can't see it.
Run docker ps-a
Find your container, copy its Id number, and run
Docker rm 85c2981e63f6 26ea04f41ab3
After deletion, run docker-compose up again
The second method is to manually delete the remaining files from / var. Specifically, you can find these files under / var / lib / docker / containers /. Each container directory has a very long hash identifier with a large number of ugly JSON output. If you search for a specific string that matches the desired container name, you will find the relevant directory that contains its configuration file.
Delete the parent directory that matches the name search, and then restart the Docker service. After that, you should be able to use your name again.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.