Aman Soni
3 min readDec 15, 2020

--

Docker Basics

If you are a beginner and struggling to learn Docker then the content below may help you to understand the Docker concepts.

So let’s start our discussion.

What is docker?

The official definition of docker is “Docker is a containerization platform that packages your application and all its dependencies together in the form of Containers to ensure that your application works seamlessly in any environment”.

At the first glance, this definition went over my head and I refused to learn the docker. But my enthusiasm didn’t allow me to refused then I started learning steps by steps.

Docker provides us a platform where we can make containers, now a question should arise that ‘What is a Container?’. Basically, Container is a running instance of Docker Image again that Docker Image word should catch our attention. Docker image is just a blueprint of our docker container both are interrelated, moreover, Docker image contains all the information required to construct a container.

In simple terms, We can define ‘Docker as a platform with help of which we can create the desired working environment’.

I hope that makes sense. Now we can move on to the next steps.

What is Docker Hub Repository?

It is the main block of Docker. It is the source of approx all the Docker images and one can easily clone the required image on the development environment. It is also used to share our images with the team for further processing.

For every action like pull, push, and run a Docker container Docker has its own dedicated commands which can be google easily.

To play with Docker I am going to take an example of mssql-server image for linux.

I will show you the steps needed to use an image from the Docker Hub Repository and use it in our Development Environment.

STEP 1:

Pull the required image from Docker Hub.

You can see I have already cloned that image.

Image showing the pulled image of mssql-server-linux image

STEP 2:

Construct a Container for the cloned image.

docker run -e “ACCEPT_EULA=Y” -e “SA_PASSWORD=ProductApi(!)” -e “MSSQL_PID=Express” -p 1445:1433 — name=MyMSSQLLinuxContainer -d microsoft/mssql-server-linux:latest

The above command sets the various environment variables which are required to run a container.

— name attribute is used to set the name of our container, — p is used to set the port.

Image showing a running Docker container

STEP 3:

We have successfully created a container mssql server for linux

let’s check it using Microsoft SQL Server Management Studio.

We have successfully connected to the server

Now we can perform all the operations on this server.

Stay tuned

Thanks

--

--

Aman Soni

Passionate Software Developer who urges to learn more,