简体   繁体   中英

Docker Container restarts automatically

I have two docker containers which are linked. The first one is a mariadb database and the other one is a MediaWiki instance. I don't need these two anymore, that's why I would like to stop and remove them.

My Problem is now, that I can't do that. I tried a lot of things already:

Executing docker update --restart=no "containers" . But it keeps restarting after I stop the container with docker container stop "container" .

Tried to remove the images with no joy as they are in use by the containers (even if I kill the container and then quickly try to delete the image)

Restarted the entire Docker service with systemctl restart docker .

I even restarted my entire Server.

All of these with no positive result. I'm kinda frustated.

I got 2 more containers running very well. (pyload and.netdata). No problems at all with them.

As I'm new in the Docker world, please tell me what you need to help me:)

Thank you in advance!

Killing the container does not delete them. You have to remove the stopped containers before you can remove the images.

docker ps shows you the list of current running container. docker ps -a will show the list of all the containers (stopped and running).

First clean up all the containers that are not running via docker rm $(docker ps -aq)

Then delete the images that you dont want docker rmi $(docker images)

Try to reset to factory setting by clicking the bug icon of docker desktop and choose "reset to factory default". It will remove everything. It worked for me. I spent days to figure this out and finally I got it. Hopefully it helps you too!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM