Last active
December 24, 2017 05:32
-
-
Save sunary/f502f6c9de8bdafb2883 to your computer and use it in GitHub Desktop.
docker tips
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
# build | |
docker build -t=image_name . | |
# start | |
docker run -d -p PORT:PORT image_name | |
# exec | |
docker exec -it container_name /bin/bash | |
# tag | |
docker tag image_name host/repository | |
# push | |
docker push image_tagged | |
# list | |
docker image ls | |
docker container ls | |
docker ps | |
# remove containter | |
docker stop $(docker ps -a -q) | |
docker rm $(docker ps -a -q) | |
# remove image | |
docker rmi $(docker images -f dangling=true -q) | |
docker rmi $(docker images -a -q) | |
# stack | |
docker stack deploy --compose-file docker-cloud.yml --with-registry-auth xxx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment