Use Docker to Containerize Your Services!

in #linux6 years ago

What is Docker?

Docker is a program that performs operating-system-level virtualization known as containerization. Containers are a lightweight, stand-alone, executable package of a piece of software that includes everything needed to run it: code, runtime, system tools, system libraries, settings.

The below image shows a docker host running three containers allowing compartmentalization of services.
Package software.png

The Basics

ImagesAn image is the base snapshot of a container. You can create an image yourself or they can be downloaded from Docker Hub. There are many images to choose from like Ubuntu, Nginx etc.
ContainersA container is an instance that spawned from an image. Containers feel like virtual machines, but they are actually just resticted processes with their own runtime environment.
SwarmsDocker Swarms are similar to clustering. Swarms are a group of docker hosts working together to host containers. There are manager and worker nodes. Managers dish out the work and the workers host the containers.
Compose FilesThese files contain commands to build a docker image.

Get started in three steps!

1. Installing

apt-get install docker.io

2. Pulling an Image (Ubuntu in the example)

docker pull ubuntu

3. Start a container with the image you pulled

docker run -i -t ubuntu /bin/bash

There you have it. You just installed docker, downloaded an image and started a container in three easy commands!

Practical example

SteemEngine.net utilizes docker to containerize every service. This allows us to easily scale out our service on demand as required. Here is an example:

  • The load balancer is a simple nginx image with a few customizations. It sends traffic to the SteemEngine webservers.
  • There are multiple Steemengine webserver containers.
  • These webserver containers talk to a backend database container.
  • All maintenance scripts open in new containers.

More helpful commands

If you want more commands - check out the docker cheat sheet


Need help getting started?

Feel free to leave a comment or question below or chat with me on the SteemEngine discord https://discord.gg/y7h45ut

Sort:  

No había escuchado sobre Docker, gracias por la información.

Congratulations @firemouse! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

Do you like SteemitBoard's project? Vote for its witness and get one more award!

Nice post friend

God I wish I understood this better. Maybe if I knew how this would have been done before docker it would make more sense to me.

It's never too late to learn!

Coin Marketplace

STEEM 0.19
TRX 0.18
JST 0.032
BTC 87663.71
ETH 3042.50
USDT 1.00
SBD 2.75