Skip to content

Kaperskyguru/my-docker-commands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 

Repository files navigation

my-docker-commands

Curated list of my popular docker commands

List Docker CLI commands

docker
docker container --help

Display Docker version and info

docker --version
docker version
docker info

Execute Docker image

docker run hello-world

List Docker images

docker image ls

List Docker containers (running, all, all in quiet mode)

docker container ls
docker container ls --all
docker container ls -aq

Build an Image

docker build --tag=friendlyhello .

Running the Image

docker run -p 4000:80 friendlyhello

To stop an Image

docker container stop CONTAINER_ID

SHARING YOUR IMAGE IN DOCKERHUB

To Login into docker hub

docker login

Tag the image

docker tag image username/repository:tag
e.g.
docker tag friendlyhello kaperskyguru/get-started:v2

Publish the image

docker push username/repository:tag

Pull and run the image from the remote repository

docker run -p 4000:80 username/repository:tag

Remove containers and images

docker container rm <hash>
docker container rm $(docker container ls -a -q)         # Remove all containers

docker image rm <image id>            # Remove specified image from this machine
docker image rm $(docker image ls -a -q)   # Remove all images from this machine

About

Curated list of my popular docker commands

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published