Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Docker maintenance commands
Prabusah
Prabusah

Posted on • Edited on

     

Docker maintenance commands

Hello there!
Here are few Docker maintenance commands.

image commands
docker image ls - lists docker images.
docker images -aq -f 'dangling=true' | xargs docker rmi - removes all unused images.
docker rmi imageId - remove an image.
docker rmi -f imageId - force remove an image
docker rmi -f $(docker images -q) - deletes all images forcefully.

instance commands
docker ps - lists running docker instances.
docker ps -a - lists docker instances (including stopped).
docker stop containerId - stops the container (proper shutdown).
docker kill containerId - stops the container (not gracefully shutdown).
docker rm containerId - remove a stopped container.
docker rm $(docker ps -a -q) - removes all stopped containers.

execution commands
docker exec -it containerName /bin/bash - Use this to interact with already running container.
docker run -it --entrypoint=/bin/bash containerName - Starts the docker and lands user in shell.
docker logs -t containerName - shows logs even for container with exited status.

Image byAlexander Fox | PlaNet Fox fromPixabay

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Cloud Architect
  • Joined

Trending onDEV CommunityHot

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp