rss logo

Docker Commands Reminder

Docker logo

A reminder of some Docker commands that I use and that I find useful.

Images management

  • List images
root@host:~# docker images
root@host:~# docker image ls
  • Remove image
root@host:~# docker image rm -f <ID>
  • Search an image
root@host:~# docker search debian
  • Install an image
root@host:~# docker image pull debian
  • List installed images
root@host:~# docker image ls
  • Start image
root@host:~# docker run --name OMSA jdelaros1/dell-omsa84

Containers management

  • List containers
root@host:~# docker ps -l
root@host:~# docker container ls -a
  • Remove container
root@host:~# docker container rm -f <ID>
  • Run a shell inside a container
root@host:~# docker container run -it <ID> /bin/bash
  • Run a container
root@host:~# docker container run <ID>
  • Stop a container
root@host:~# docker stop <ID>
  • Run command on a running container
root@host:~# docker exec <ID> <COMMAND>
  • List "exited" status containers
root@host:~# docker ps -a -f status=exited
  • Remove "exited" status containers
root@host:~# docker rm $(docker ps -a -f status=exited -q)
  • Open root bash
root@host:~# docker exec -u 0 -it <ID> /bin/bash
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Contact :

contact mail address