Skip to content

Instantly share code, notes, and snippets.

@ohmydevops
Last active July 14, 2019 21:01
Show Gist options
  • Save ohmydevops/ee581a9e40b6f6a448be76025ea604a8 to your computer and use it in GitHub Desktop.
Save ohmydevops/ee581a9e40b6f6a448be76025ea604a8 to your computer and use it in GitHub Desktop.
docker cheat sheet
docker build -t myimagename .
docker run -p 4000:80 myimagename
docker run -d -p 4000:80 myimagename
docker exec -it [container-id] bash
docker ps
docker stop <hash>
docker ps -a
docker kill <hash>
docker rm <hash>
docker rm $(docker ps -a -q)
docker images -a
docker rmi <imagename>
docker rmi $(docker images -q)
docker login
docker tag <image> username/repository:tag
docker push username/repository:tag
docker run username/repository:tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment