Last active
March 14, 2021 00:09
-
-
Save crshmk/e77c9bf5d75b1f80866481980bff306f to your computer and use it in GitHub Desktop.
Standard Docker commands
This file contains hidden or 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
# download and run an image | |
docker run image-name | |
# list images | |
docker images | |
# build an image | |
docker build -t image-name <path> | |
# run an image | |
docker run --name container-name -p 8080:8080 -d image-name | |
# list running containers | |
docker ps | |
# list all containers | |
docker ps -a | |
# get more container info | |
docker inspect container-name | |
#run a shell inside a container | |
docker exec -it container-name bash | |
# ps aux inside the shell shows processes running on the host OS, but namespaced for this container | |
# stop running container | |
docker stop container-name | |
docker stop container-id | |
# rm container | |
docker rm container-name | |
# tag your image for docker hub | |
docker tab image-name <dockerHubId>/image-name | |
# push to docker hub https://hub.docker.com | |
docker push <dockerHubId>/image-name | |
# terminal log into docker hub | |
docker login |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment