Skip to content

Instantly share code, notes, and snippets.

@davidbarkhuizen
Last active October 14, 2022 13:05
Show Gist options
  • Select an option

  • Save davidbarkhuizen/c607a8d42e2781036deaa61bd6c4e886 to your computer and use it in GitHub Desktop.

Select an option

Save davidbarkhuizen/c607a8d42e2781036deaa61bd6c4e886 to your computer and use it in GitHub Desktop.
docker

heirarchy

  • registry -- repo --- image ---- tag (version)

find name of docker servce in windows

sc queryex type= service state= all | find /i "docker"

get docker version

docker --version

list images

docker image ls

list all running containers

docker container ls

list all containers, running or not

docker container ls --all

execute image xxx, mapping internal port 80 to external port 4000

docker run -p 4000:80 xxx execute as above, but running in detached / background mode docker run -d -p 4000:80 xxx

build docker image

  • from local Dockerfile in current directory
  • with friendly name xxx
  • submitting to local docker image registry

docker build -t xxx .

stop running container with id yyy

docker container stop yyy

log in to the public registry on your local machine

docker login

tag image image_name with tag tag_name, for username user_name, repo repo_name,

docker tag image_name user_name/repo_name:tag_name

delete all stopped containers

docker container prune

get info on docker image image_name, for user user_name, repo repo_name, tag tag_name

docker inspect --type=image user_name/repo_name:tag_name

delete all local docker images

docker image prune -a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment