Introduction to Docker

Introduction to Docker

·

2 min read

Docker is an open-source containerization platform that enables developers to package applications into containers.

containers are standardized executable components combining application source code with the operating system libraries and dependencies required to run that code in any environment.

Terminologies

  1. DockerFile - text document that contains all the commands a user could call on the command line to assemble an image
  2. Image - A Docker image is a file used to execute code in a Docker container. Docker images act as a set of instructions to build a Docker container, like a template.
  3. Container– A running instance of an image
  4. Docker volume - creates a volume without having to define a Dockerfile and build an image and run a container. It is used to quickly allow other containers to mount the said volume.

overview

image.png When Do we Use Docker? Why can’t I run the application in the normal way ?node/nodemon file.js Why go through the pain of writing dockerfile, creating images and containers? well here is why .....

  1. Makes running applications easy when working in teams.
  2. Create a similar production and development environment 1.jpg Docker creates a “common” environment ( docker images ) and each team can run their own instances ( docker containers ).
  3. Smooth integration with ci/cd practices. Containers are great for continuous integration and continuous delivery (CI/CD) workflows. Developers can write code locally ,share their code using docker containers and push their applications into test environment, if they find bugs they can fix and test them in the respective environment and redeploy by pushing the updated image image to production.

Installation

Windows

  1. docs.docker.com/desktop/windows/install
  2. docs.microsoft.com/en-us/windows/wsl/instal..
  3. Enable Hyper-V Windows Features
  4. Install required Windows components for WSL 2
  5. 4GB system RAM
  6. BIOS-level hardware virtualization support must be enabled in the BIOS settings..

Linux

docs.docker.com/engine/install

Let’s Dockerize our first App in the next Article!