Skip to content

Instantly share code, notes, and snippets.

@sunary
Last active December 24, 2017 05:32
Show Gist options
  • Save sunary/f502f6c9de8bdafb2883 to your computer and use it in GitHub Desktop.
Save sunary/f502f6c9de8bdafb2883 to your computer and use it in GitHub Desktop.
docker tips
# 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