Confused about how to get started with Docker? Learn About Docker in Just 5 minutes!

Rumana Shaikh
RumPyDas
Published in
5 min readAug 21, 2019

Here is the First Blog for the Series Deployment Made Easy for Machine Learning Dev-OPS Engineers!

This Medium Blog will help you understand, what is Docker, how does a Docker work and components of Docker and allows you to have hands on practice on Docker

Now, let us get started and understand Docker platform and learn how to create and use containers.

Below topics are explained in this Docker Blog:

1. What is Docker?

2. How does Docker work?

3. What are the components of Docker?

4. Basic commands of Docker

5. How do you setup Docker locally in your system

6. Run your First Docker

First Let’s understand the need of Docker

Problem: The Code doesn’t work on the other systems due to the difference in computer environment

Docker is a tool which is used to automate the deployment of the application in lightweight containers so that applications can work efficiently in different environments.

A container is a software package that consists of all the dependencies required to run an application. Until now we have been running applications on virtual machines. Every virtual machine used to be the base of our application but now with the advent of Docker and containerization technologies each application is run in a container like logical space.

So Lets Compare the options available to solve our problem

NOTE : Container is a software package that consists of all the dependencies required to run an application.

Well let’s understand docker with the help of an example as given below

Lets find out about How does Docker works?

Components of Docker

Docker Components
Docker Client and Server
Docker Image

NOTE: Dockerfile is a File which contains the commands to build the docker images.

Docker Container
Docker Registry

How Do You Use a Docker?

The biggest advantage of VMs is that they create snapshots which can be revisited instantly later. Docker containers further enhance the lightweight process virtualization by being OS independent and using the Linux Kernel’s functionality. They are created from Docker images — like snapshots. Docker images are created using a Docker file which can be customized or used as is. The default execution driver for creating a docker container is ‘libcontainer’. Docker Hub can be used for searching docker images and seeing the way they have been built.

  • To create a Docker container, download the ‘hello world’ image, by typing the following command in the terminal –

$ docker run hello world

  • For checking the number of images on your system, use the following command –

$ docker images

  • For searching an image in the Docker Hub –

$ docker search <image>

Here’s a List of Docker Commands

  • docker run — Runs a command in a new container.
  • docker start — Starts one or more stopped containers
  • docker stop — Stops one or more running containers
  • docker build — Builds an image form a Docker file
  • docker pull — Pulls an image or a repository from a registry
  • docker push — Pushes an image or a repository to a registry
  • docker export — Exports a container’s filesystem as a tar archive
  • docker exec — Runs a command in a run-time container
  • docker search — Searches the Docker Hub for images
  • docker attach — Attaches to a running container
  • docker commit — Creates a new image from a container’s changes

Check out the complete list of commands in the Docker documentation

How Do You Setup a Docker Locally

  • Download a Docker edition and the Docker Toolbox
  • Make sure your BIOS has Virtualization Technologies, AMD-V, or KVM enabled
  • Install the Extension Pack in the Oracle VirtualBox.
  • Run the Setup

Well, Congratulations! you now have fair knowledge about dockers.

Stay tuned for my upcoming Blogs on Kubernates and Deployment and let me know on which topic should I write next by commenting below. Do clap if you liked the content and wish to see more.

Thanks for reading my blogs and have a Great Day!

--

--