Last active
June 11, 2018 08:17
-
-
Save silversonicaxel/e7731eb9b9aeb4fcd33a36a991b6e2fe to your computer and use it in GitHub Desktop.
DOCKER
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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