Why Containerization?

This is the question I get more often.

Over the years I have tried to improve this answer as much as possible.

In this thread with Memes, I will do my best.

a /thread (with Memes)
When an application is developed, we have:

- a development environment
- a production environment.

The application is created, improved, new features are added, bugs are corrected.

All of this happens in the development environment.

No memes? wait for it...
We have the usual problems:

- install dependencies
- understand what the problem is
- add a new shiny feature

And we also write a lot of code...

Once the development is done, developers are happy!
Why? because “It works on my machine”.

What's the problem?
When we go into production, we would like to recreate the same, identical environment.

What we can do is write a procedure to recreate the same exact environment. We could have issues because, for example, we are on a different operating system!
We would have to reinstall the same dependencies and we would have to re-create the same configuration on the production machine, and we would have many problems.

Now, to be completely honest, this problem has already been solved in the past: With virtual machines.
We create a virtual machine, which contains an operating system, and all necessary dependencies and configurations

Then we run the virtual machine on the operating system of the physical machine through a Hypervisor (a tool to manage Virtual Machines).
Problem solved, right?

Well yes and no, because even virtual machines have their own operating system, and they must be configured correctly to work, so we are (almost) at the starting point.
To create virtual machines we have a very long configuration written somewhere, and if something changes it must be carefully noted down.

Furthermore, it is quite evident that we are facing a waste of resources: We are recreating an entire system on top of a system
We would just ship our (maybe small) application with our dependencies!

So why am I here saying say that containers are cool and that Docker is awesome?

Because containers solve the same problem, the shipping of an application, in a much simpler and smarter way.
Containerization technologies (Docker is just one of them) use a standard, to isolate the application with all:

- dependencies
- configuration
- code

in something called Images.

Based on these images, containers can be created and started.
To make an analogy with the world of programming, an image is a class, and a container is an instance of that class.

The good news is that a ton of images, of the most famous technologies, already exists!
Another advantage of using containerization since development is the possibility of using different versions for different projects at the same time (without even installing them).
For things like Node.js, there are solutions, like NVM, to switch between versions, but for others is not that easy.

Let's say we want to use Postgres version 10 for one project but we need to use Postgres 9 for another.

And we also have Postgres 12 installed.
Now, using all 3 of them, changing ports every time depending on which project you are working on, is really a pain and it can lead to headaches.

Instead, we would like to have separated dev environments for the 2 projects, without configuring ad-hoc machines
We could solve this using VM, but then we should manage them and it's very resource consuming

This with docker can be avoided, simply by using a version of Postgres present on Docker Hub (a docker registry that contains a lot of images).
Also in a company, a machine can be configured so different developers can work on different projects using different versions at the same time

They can work on different projects without colliding.

They can work on different versions of the same project!
Last thing...

Docker can't solve all your problems!

But it can make your life easier as a developer, which is already a lot!
If you like this style of teaching, please follow @FrancescoCiull4 and RT this to spread the word. Thank you

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Francesco Ciulla

Francesco Ciulla Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @FrancescoCiull4

28 Sep
I have been interviewed by William Quiviger in the Official Docker Captain Take 5

Article: docker.com/blog/docker-ca…

/thread format⬇️
How/when did you first discover Docker?

It was 2015. I was curious and started researching. I didn’t have any online presence at the time so I was just studying on my own trying to figure out how it worked.
Now I know many Docker Captains, like @BretFisher @mikesir87 , @GianArb!
What is your favorite Docker command?

This is a nice question! I think I will go with “docker compose up –build”, this is exactly what you need to test your command on your development environment.

Another one is docker exec, it’s very handy.
Read 12 tweets
28 Sep
Resources that link Blockchain to Docker🐳
· Create Ethereum Dapp with React + Docker
· Deploying Blockchain Applications with Docker
· Docker usage in Blockchain
· Docker in Blockchain Projects
· Go Ethereum (Go implementation of Ethereum protocol)

Have more? Share it

/thread
Create an Ethereum Dapp with React and Docker

medium.com/hackernoon/cre…
Deploying Blockchain Applications with Docker

Docker provides great support in quickly getting a blockchain node up and running without the need to individually configure each machine separately.

skeps.com/blog/deploying…
Read 7 tweets
28 Sep
Blockchain Blocks

Blockchain blocks hold batches of valid transactions into a Merkle tree.

Basic concepts to study how they work:
· Hash
· Sign
· Genesis Block
· Fork
· Consensus Algorithm
· Peers and the database
· History
· New entries
· Redundant Computation

/thread
Hash

A hash is a math function that converts an input of arbitrary length into an encrypted output of a fixed length.

· Each block includes the cryptographic hash of the previous, linking the two.

·Blocks are hashed and encoded.
Digital signature

A digital signature is an auth mechanism.
It enables the creator of the message to attach a code that acts as a signature.

· The blocks are usually digitally signed.

· This is to assure the integrity and the data
Read 10 tweets
24 Sep
I studied Blockchain at University.

Now I decided to learn it again. From Zero.

Here is a thread to summarizes what I have studied so far.

/thread
Summary:
· What is a Blockchain
· Blocks
· Resistance to modification
· Secure by design
· Structure
· Verification
· Robust workflow
· Value Exchange protocol
· Layers
· What is a Blockchain

It's a growing list of records (blocks)

The Blocks are linked together using cryptography.

It's described as an immutable data storage:
- trustless
- fully decentralized
- peer-to-peer
- immutable

It's spread over a network of participants (nodes)
Read 12 tweets
23 Sep
Francesco, you are so productive!

Many know me now for being a very productive, active, and a morning person.

Have I always been like this? Absolutely NOT!

What has changed for me? How can you change your life? Let's see it in 5 minutes.

Inspired by @Shruti_Narwani
/thread
In 2012 for personal reasons, I was depressed and without the slightest desire to do anything.

What do you we in these difficult moments?

The first thing is to keep ourselves busy, literally with anything.

For example, I got my motorcycle license and started kickboxing

1/11
Then we have to work on ourselves, starting from the basics.

We cannot expect our life to change in one day, but we can decide the direction we want to go in.

Exercising and putting yourself in the best physical condition, is very important and at the basis of everything

2/11
Read 13 tweets
12 Aug
11 Fundamental Docker Definitions for:

🏠Docker host
⚙️Docker engine
🖥️ Docker client
😈Docker daemon
📝Dockerfile
📦Docker Image
🐳Docker Container
🔗Docker Network
💾Docker volumes
🐙Docker Compose
🪣 Docker Registry

Keep reading for short definitions:
/thread⬇️
1/11 🏠Docker (Active) Host

A computer with Docker installed and the daemon running.

It can process Docker and non-Docker workloads.
2/11 ⚙️Docker Engine

A Client-Server application.
It has 3 components:

- CLI: A command-line interface client.

- daemon process: A server that is a type of long-running program.

- Rest API: to specify interfaces that programs can use to talk and interact with the daemon.
Read 13 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(