Docker Basic Commands

Show Version of Docker


#docker version

Remove all stopped containers.

#docker docker rm $(docker ps -a -q)

This will remove all stopped containers by getting a list of all containers with docker ps -a -q

Remove all untagged images

In the process of running docker you can accumulated several images that are not tagged. To remove these I use this command:
#docker rmi $(docker images | grep "^<none>^" | awk "{print $3}")


Search docker images from the docker hub

#docker search <image name>

Pull a docker images


#docker pull <image name>

Run a container


#docker run <container image>  command 
example:
docker run fedora echo "hello world"

Comments

Popular posts from this blog

How to clean all the foreman task and locked task

How to restrict users to send only mail to the local domain in Zimbra

Hardening Script