Docker.docx

  • Uploaded by: Omkar Singh
  • 0
  • 0
  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Docker.docx as PDF for free.

More details

  • Words: 259
  • Pages: 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 # 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 Delete / Remove Docker Container images

# docker rm db_container2 # 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

More Documents from "Omkar Singh"