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

Docker

This document provides instructions for various Docker commands to manage Docker containers and images. It describes how to verify the Docker version, view system information, search images, pull images, list images, run and launch containers, attach to containers, view running containers, start/stop/restart/kill containers, remove containers and images, save and load images, export and import containers, view image history, fetch container logs, view resource usage, and display container IP addresses.

Uploaded by

Omkar Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
573 views

Docker

This document provides instructions for various Docker commands to manage Docker containers and images. It describes how to verify the Docker version, view system information, search images, pull images, list images, run and launch containers, attach to containers, view running containers, start/stop/restart/kill containers, remove containers and images, save and load images, export and import containers, view image history, fetch container logs, view resource usage, and display container IP addresses.

Uploaded by

Omkar Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Verify Docker Version : docker --version

View system wide Information - docker info

Search Docker Images in its Registry Server : docker search debian

Downloading Docker Container Images : # docker pull <Name-of-Image>

# docker pull centos

Downloading Specific OS version Docker Image : # docker pull ubuntu:14.04

List all Downloaded Docker Container Images : # docker images

Launching a container with ‘docker run’ command :

# docker run -it -p 9000:80 --name=debian_container1 debian

Launching a Container in detach mode

# docker run -it -d -p 9001:80 --name=web_container centos:7

Getting Container Console with ‘docker attach’

# docker attach {container_name or container_id}

List Containers with ‘docker ps’ command

# docker ps

Start, Stop, Restart and Kill Containers

# docker stop db_container

# docker start db_container11

# docker restart db_container1

# docker kill db_container2

Delete / Remove a Container # docker rm db_container2

Delete / Remove Docker Container images # docker rmi ubuntu:14.04

Save and Load Docker Container Image to/from a tar file

# docker save debian -o mydebian.tar

Load Docker Image from tar file. # docker load -i mydebian.tar

Export and Import Container to / from tar archive

# docker export container_name_or_id

# docker export web_container -o web_container.tar


Display History of Docker Image

# docker history {Image_Name_OR_Image_id}

# docker history ubuntu:16.04

Fetching Logs from the Container # docker logs {container_name_or_container_id}

# docker logs xibodocker_cms-web_1

Containers’ resource usage statistics

# docker stats

# docker stats --no-stream

# docker top {Container_Name_OR_ID}

# docker top xibodocker_cms-web_1

Display Container IP address

# docker inspect web_container | grep IPAddress | cut -d '"' -f 4

You might also like