0% found this document useful (0 votes)
19 views

Docker Commands

The document provides information about various Docker commands to build, run, list, and manage Docker images and containers. It also includes examples of using Docker Compose to deploy stacks and manage services and tasks.

Uploaded by

satg.lenovo
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Docker Commands

The document provides information about various Docker commands to build, run, list, and manage Docker images and containers. It also includes examples of using Docker Compose to deploy stacks and manage services and tasks.

Uploaded by

satg.lenovo
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

docker build --no-cache -t airconf/artillery:0.1 .

## 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

docker build -tag=friendlyhello:v0.0.1


docker run -p 4000:80 friendlyhello

docker build -t friendlyhello . # Create image using this directory's Dockerfile


docker run -p 4000:80 friendlyhello # Run "friendlyname" mapping port 4000 to 80
docker run -d -p 4000:80 friendlyhello # Same thing, but in detached mode
docker container ls # List all running containers
docker container ls -a # List all containers, even those not running
docker container stop <hash> # Gracefully stop the specified container
docker container kill <hash> # Force shutdown of the specified container
docker container rm <hash> # Remove specified container from this machine
docker container rm $(docker container ls -a -q) # Remove all containers
docker image ls -a # List all images on this machine
docker image rm <image id> # Remove specified image from this machine
docker image rm -f $(docker image ls -a -q) # Remove all images from this machine
docker login # Log in this CLI session using your Docker credentials
docker tag <image> username/repository:tag # Tag <image> for upload to registry
docker push username/repository:tag # Upload tagged image to registry
docker run username/repository:tag # Run image from a registry

docker stack ls # List stacks or apps


docker stack deploy -c <composefile> <appname> # Run the specified Compose file
docker service ls # List running services associated with an app
docker service ps <service> # List tasks associated with an app
docker inspect <task or container> # Inspect task or container
docker container ls -q # List container IDs
docker stack rm <appname> # Tear down an application
docker swarm leave --force # Take down a single node swarm from the manager

java -Dwebdriver.chrome.driver=chrome/chromedriver.exe -jar selenium-server-


standalone.jar -port 4444

docker run -it -e ENV=qa --shm-size=1024m --entrypoint "/bin/bash" -v


%cd%/logs:/logs airconf/nightwatch:0.2
docker exec -it pid --entrypoint "/bin/bash"

You might also like