Get to know Container

What is container

Container isolate application from its environment and ensure that it works on different environments.

When do we use container

  1. Distributing application architectures to accelerate software delivery

  2. Moving apps beyond test into staging and production environments

  3. securing and managing the app and the underlying infrastructure

What problem did it solve

Container technology like Docker aims to solve following problems

  1. system error may arise when moving application across different operation system
  2. dependency conflict may arise when using different application technologies on a single machine

How do containers solve this problem

A container contains the entire runtime environment of the application including the application itself, the dependencies, libraries and other config files. All these things will be encapsulated into a single package.

By containerizing the application platform and its dependencies, differences in OS distributions and underlying infrastructure are abstracted away.

What other benefits do containers offer

  1. accelarates integration and deployment process
  2. allows developers to use suitable tools for each service, because container can isolate each service
  3. helps optimising the infrastructure usage, because containers allow running serveral different applications on a single machine without any conflict

Container vs Virtual Machine

container vs VM

Containers share OS kernel and work independently; VM contains an entire OS system for each app

Docker easy setup

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# install depenencies
sudo yum install -y yum-utils device-mapper-persistent-data lvm2

# setting yum source
sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

# install docker-ce (community edition)
sudo yum install docker-ce

# setting auto start
sudo systemctl enable docker

# starting docker service
sudo systemctl start docker

# set user groups
# create user group
sudo groupadd docker
# add current user into docker group
sudo usermod -aG docker $USER

Docker management tools

  1. Kubernetes
  2. shipyard
  3. portainer
  4. dockerUI