docker enters the container and reports: Error response from daemon: Container ***** is not running

1. The docker container is not started Solution: start the container

Steps:

1. Use the command to view the docker container id: docker ps -a;

2. Use the command: docker start container id to start the docker container.

3. Then you can use the command: docker exec -it container id /bin/bash to enter the docker container.

2. The network configuration has been changed, the solution: restart the network

Use the command: source /etc/profile

3. Configuration file problem, solution: modify the configuration file

Example: An error occurred in the configuration file change in mysql, the operation steps are as follows:

1. Copy the configuration file from the container to the local

docker cp container id:/etc/mysql/my.cnf /opt

2. Modify the configuration file locally and save it

Use the command: vi /opt/my.cnf

3. Copy the changed configuration file to the docker container

docker cp /opt/my.cnf container id:/etc/mysql

4. Restart the container

docker restart container id

5. View the process started in the docker container

docker ps -a
 

Guess you like

Origin blog.csdn.net/weixin_64043217/article/details/132149103