☁️
Cloud Computing
  • Introduction
  • Terminologies
    • Container
    • Kubernetes (K8s)
    • Serverless Computing
  • Services
    • Docker
    • Terraform
  • ☁️Cloud Computing Platforms
    • Google Cloud
      • Google Cloud Essentials
      • Management
        • Cloud IAM
      • Compute
        • Compute Engine
        • Kubernetes Engine
      • Resources
    • IBM Cloud
      • IBM Cloud Shell
      • Compute
      • Containers
      • Developer tools
      • Integration
      • Storage
      • Cloud Paks
    • Microsoft Azure
      • Compute
        • Functions
        • App Services
      • Networking
      • Storage
      • Web
      • Mobile
      • Databases
        • Cosmos DB
      • Analytics
      • AI + Machine Learning
      • Internet of things
      • Security
      • DevOps
      • Monitoring
      • Management and governance
      • Azure Stack
    • Amazon Web Services
    • Resources
  • Qwiklabs Challenge Labs
    • Create and Manage Cloud Resources
    • Deploy and Manage Cloud Environments with Google Cloud
    • Create ML Models with BigQuery ML
    • Insights from Data with BigQuery
    • Build a Website on Google Cloud
    • Build and Deploy a Docker Image to a Kubernetes Cluster
    • Build and Secure Networks in Google Cloud
    • Set Up and Configure a Cloud Environment in Google Cloud
    • Build and Optimize Data Warehouses with BigQuery: Challenge Lab
    • Scale Out and Update a Containerized Application on a Kubernetes Cluster
  • Whizlabs Challenge League
Powered by GitBook
On this page
  • Lifecycle Commands
  • Starting and Stopping Containers
  • Docker Image Commands
  • Docker Container And Image Information
  • Network Commands

Was this helpful?

  1. Services

Docker

PreviousServerless ComputingNextTerraform

Last updated 1 year ago

Was this helpful?

Image = application + dependencies

Containers - An instance based on an image that runs on a "Docker Host"

Lifecycle Commands

  • Create a container (without starting it):

docker create [IMAGE]
  • Rename an existing container

docker rename [CONTAINER_NAME] [NEW_CONTAINER_NAME]
  • Run a command in a new container

docker run [IMAGE] [COMMAND]

-d - detached application will run in background and will not show any console output

-p - publish port <host>:<container>

--name - optional

-v - mount a volume

--link - communicate between containers

  • Remove container after it exits

docker run --rm [IMAGE]
  • Start a container and keep it running

docker run -td [IMAGE]
  • Start a container and creates an interactive bash shell in the container

docker run -it [IMAGE]
  • Create, Start, and run a command inside the container and remove the container after executing command.

docker run -it-rm [IMAGE]
  • Execute command inside already running container.

docker exec -it [container]
  • Delete a container (if it is not running)

docker rm [CONTAINER]
  • Update the configuration of the container

docker update [CONTAINER]

Starting and Stopping Containers

  • Start Container

docker start [CONTAINER]
  • Stop running Container

docker stop [CONTAINER]
  • Stop running Container and start it again

docker restart [CONTAINER]
  • Pause processes in a running container

docker pause [CONTAINER]
  • Unpause processes in a running container

docker unpause [CONTAINER]
  • Block a container until others stop

docker wait [CONTAINER]
  • Kill a container by sending a SIGKILL to a running container

docker kill [CONTAINER]
  • Attach local standard input, output, and error streams to a running container

docker attach [CONTAINER]

Docker Image Commands

  • Create an image from a tarball

docker import [URL/FILE]
  • Create an image from a container

docker commit [CONTAINER] [NEW_IMAGE_NAME]
  • Load an image from a tar archive or stdin

docker load [TAR_FILE/STDIN_FILE]
  • Save an image to a tar archive

docker save [IMAGE] > [TAR_FILE]

Docker Container And Image Information

  • List real-time events from a container

docker events [CONTAINER]
  • Show port mapping for a container

docker port [CONTAINER]
  • Show running processes in a container

docker top [CONTAINER]
  • Show live resource usage statistics of container

docker stats [CONTAINER]
  • Show changes to files (or directories) on a filesystem

docker diff [CONTAINER]
  • List all images that are locally stored with the docker engine

docker [image] ls
  • Show the history of an image

docker history [IMAGE]

Network Commands

  • List networks

docker network ls
  • Remove one or more networks

docker network rm [NETWORK]
  • Show information on one or more networks

docker network inspect [NETWORK]
  • Connects a container to a network

docker network connect [NETWORK] [CONTAINER]
  • Disconnect a container from a network

docker network disconnect [NETWORK] [CONTAINER]
Empowering App Development for Developers | DockerDocker
Logo