Last active
May 21, 2022 11:24
-
-
Save amrutprabhu/576a6599a39d89960ee297f3ca54f2e9 to your computer and use it in GitHub Desktop.
docker commands cheat sheet for my reference
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
Install docker : curl -fsSL https://get.docker.com -o get-docker.sh | |
docker-machine create vm1 | |
----- Containers ------- | |
docker container run --name search -d --network my_net elasticsearch:2 | |
docker container run --rm -it elasticsearch:2 /bin/bash | |
docker container exec -it nginx bash | |
docker container ls | |
docker container rm -f (docker container ls -aq) | |
docker container prune | |
docker container inspect compose-assignment | |
docker container ps | |
--- remove/delete dangling images --- | |
docker rmi $(docker images --quiet --filter "dangling=true") | |
or | |
docker rmi $(docker images -q -f dangling=true) | |
docker image history | |
docker network create net --driver overlay | |
docker network ls | |
---- compose --------- | |
docker-compose up -d | |
------- swarm ---------- | |
docker stack deploy -c docker-compose.yml mystack | |
docker swarm init | |
docker swarm leave | |
docker stack rm MyProxy | |
docker service update search --replicas 3 | |
docker service create --name search -p 9200:9200 elasticsearch:2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment