All Articles

Time to Play with Docker

docker

In the field of virtualization, Docker is a great tool which is very lightweight compared to the triditional virtual machines. It enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. By taking advantage of Docker’s methodologies for shipping, testing, and deploying code, you can significantly reduce the delay between writing code and running it in production.

To start the journey with Docker, first, we need to install Docker on our machine. The community version of Docker is free and open-source, and it’s available for most of the operating systems like Linux, Windows, and macOS.

Official Installation Instructions

Useful Docker Commands

After installing Docker, you can start playing with it. Here are some basic example commands in daily use. More commands can be found in the official documentation.

whole system

  • docker login - Log in to a Docker registry
  • docker info - Display system-wide information
  • docker version - Show the Docker version information

images

  • docker images - List images
  • docker rmi - Remove one or more images
  • docker pull - Pull an image or a repository from a registry
  • docker push - Push an image or a repository to a registry
  • docker build - Build an image from a Dockerfile

containers

  • docker ps - List containers
  • docker run - Run a command in a new container
  • docker kill - Kill one or more running containers
  • docker exec - Run a command in a running container
  • docker commit - Create a new image from a container’s changes
  • docker cp - Copy files/folders between a container and the local filesystem

Published Jul 21, 2017

Flying code monkey