Getting Started with Container Technology

Divyaansh Jain
5 min readNov 25, 2020

Let’s see first “What is a CONTAINER” ?

A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. Basically, it means that if you want to run a single application with multiple dependencies that can affect other applications in your environment, so you can run that application in a completely isolated environment so that it won’t have any effect on other applications.

Now the question here is : How can we do that ?

Containers technology has changed the way applications are delivered in an IT environment. There are several tools available in the market for implementing container technology, and the choice lies with the company on how they want to use it in their environment. Some of the container tools are:

  1. Docker
  2. Podman
  3. CRI-O
  4. Containerd
  5. Microsoft Containers , and so on.
Source: https://www.docker.com/resources/what-container

The best choice depends on the requirement of the company or on their strategies of implementing DevOps in their working environment.

Let us learn something about Docker since it is the first open-source container tool which emerged to be the standard for implementing container technology.

What is DOCKER ?

A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.

What it simply means is that, it can do everything which you need to run your application, code or anything with minimum amount of computing resources and in a completely isolated environment.

Docker images on running becomes Containers when they run on Docker Engine. It is available for Windows and Linux distributions such as CentOS, Ubuntu, Fedora as well as Debian and regardless of the infrastructure, the containerized applications will always run in the same way.

You can download Docker on your machine or you can also use Online Interactive Learning Platforms such as Katacoda for learning Docker commands.

Some of the basic commands are stated below:

  1. To check the list of images downloaded in your local system

$ docker images

2. To search for a docker image from Docker Hub

$ docker search <image_name>

3. To pull an image or a repository from a registry

$ docker pull <image_name>

4. To check the list of running containers

$ docker ps

5. To check the list of stopped as well as running containers

$ docker ps -a

6. To run a container in detached mode or in background

$ docker run -d <image_name>

7. To run a container with an interactive terminal of the image

$ docker run -it <image_name>

8. To return low-level information on Docker objects

$ docker inspect <container_id>

Note: Here, we can give initial 3–5 characters of container id since every id is different or we can also give container name.

9. To run the container and publish the container port to host port

$ docker run -p [container_application_port_no]:[host_port_no] <image_name>

Note: Here, host port number can be any port number which is not in use by the host and if this port number is not given , then any port number is dynamically assigned.

10. To run a container and create a link between host directory and container directory

$ docker run -v [host_directory_path]:[container_directory_path] <image_name>

11. To run a container and assigning specific name to it

$ docker run --name [NAME] <image_name>

12. To start a stopped container

$ docker start <container_id>

13. To stop a running container

$ docker stop <container_id>

14. To attach local standard input, output, and error streams to a running container

$ docker attach <container_id>

These are some basics commands which will help you to get started with docker and container technology.

I will discuss some technologies in the further blogs, till then have a read at this.

Signing off

Link for my LinkedIn profile:

https://www.linkedin.com/in/divyaansh-jain-9b968a170/

--

--