Skip to content

Instantly share code, notes, and snippets.

@silversonicaxel
Last active June 11, 2018 08:17
Show Gist options
  • Save silversonicaxel/e7731eb9b9aeb4fcd33a36a991b6e2fe to your computer and use it in GitHub Desktop.
Save silversonicaxel/e7731eb9b9aeb4fcd33a36a991b6e2fe to your computer and use it in GitHub Desktop.
DOCKER
// information about docker
$ docker --version
$ docker info
// create a docker container
$ docker build -t <tagname> .
// list docker containers running
$ docker ps
// list docker containers ids running
$ docker ps -q
// list docker containers running and stopped (instantiation of images)
$ docker ps -a
// list docker images
$ docker images
// list docker images ids
$ docker images -q
// force remove all images
$ docker rmi -f $(docker images -q)
// stop running docker containers
$ docker stop [CONTAINER_ID]
$ docker stop $(docker ps -q)
// remove docker containers
$ docker rm [CONTAINER_ID]
$ docker rm $(docker ps -q)
// check realtime logs of a container
$ docker logs -f [CONTAINER]
// stop running of all running containers and remove them
$ docker stop $(docker ps -q) && docker rm $(docker ps -aq)
$ docker rm -f $(docker ps -aq)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment