Build, ship, run — anywhere. Containers!

~1000 words ~80 slides ~10 minutes

sasa.kovacevic
THREE DAYS AWAKE

--

Level 200, intermediate material. Assumes little or no expertise with topic and covers topic concepts, functions, features, and benefits. Provides specific details about the topic.

Before you dig in, here is a quick info on how to reach me — Twitter | LinkedIn.

Let me know what you loved, what you hated, what left you unimpressed and what you want to know more about.

If you’d prefer to listen to great music while reading, check out SomaFm.com
(no affiliation, not sponsored, justgreatlyenjoyed).

Why this topic?

Containers have become a hot topic these days, and this is my attempt to explain why. They certainly have a compelling use case and you should really consider investing some time to understand containerization.

So, let’s learn more about containers.

But before we do — I’ll talk (write) about a lot of topics here, but don’t worry, most of them will be mentioned in passing only, as I’ll go into more details at some other times. Just be ready to think fast and try and pick up various tidbits here and there, so that you can dig deeper on a particular topic when the need arises.

History of actual, physical containers.

Before going into the software containers, consider the actual physical ones. Everything about them relates directly to software containers. You’ll be surprised.

And there are some fun and interesting facts, that you probably did not know.

We cannot agree on currency, electricity standard, which side of the road to drive, measurement units, daylight savings time, copyright standards, but there is only one standard for the shipping container on the planet.

Intermodal Container

Invented and tested in 1956, it took just 4 years to standardize it. And it is still in use today.

How useful is it, when the entire planet readily agreed on the standard for the shipping container?

40 foot (12m) container accounts for over 90% of all containers. 20 million containers are in use today, and they make over 200 million trips each year.

10 thousand are lost at sea every year, that is on average 1 every 53 minutes. 97% of them are manufactured in China, and they last on average 25 years.

MSK U 123456 5

Naming is also standardized and consists of the owner name, the letter U (stands for shipping containers), container number and a checksum digit.

The fact that the shipping containers are standardized means that good produced and put into a container on a ship in China, can be transported to Europe/Africa/Americas, put on trains and trucks and transported anywhere. Containers can even be transported by helicopters and special planes.

The containers can be created in LEGO sets, and some people work/live in containers.

Before shipping containers, individual goods were loaded directly onto cargo ships. Loading a ship took a week to load 200 thousand pieces of cargo. 60–70% of the cost was labor, including loss of time. Today, 10 thousand containers can be loaded in under 60 minutes — with 0 people. Before containers, loading cargo cost $5.86 per ton. Containerized, loading cargo costs $0.16 per ton. 36 times cheaper.

7 rules when loading containers on a ship.
1 — Cold containers need power. 2 — Guard the vessel at all times. 3 — Heaviest containers to bottom. 4 — Flammable stuff on the inside (because of pirates, which shoot flares and incendiary ammo). 5— Every container has an ID. 6 — Keep certain chemicals apart.
7 — Minimize the number of crane moves. Algorithmically planned and executed.

Docker

The defacto standard for software containers today.

Alternatives

Google has LMCTFY (Let Me Contain That For You), which may become an optional execution engine withing the Docker engine.

Microsoft has Drawbridge (since 2011). Future is uncertain at this time.

LXD (by Cannonical) containers don’t share processes providing full operating system isolation.

Rocket (by CoreOS) allows far more customization than docker at the expense of simplicity.

Docker is everywhere.

Ubuntu. Alpine. Windows (through Alpine). Windows native (directly and through Hyper-V - the Hyper-V containers provide and additional layer of server security). OS X. Azure. AWS. IBM.

Advantages

Ubiquitous (present, appearing or found everywhere).

No platform lock in — in fact should you decide you do not wish to have your application / service in Docker simply recreate the environment elsewhere and deploy.

The same container works on developer’s machine, in hosting, or in the cloud.

Since it is the defacto standard, you benefit from everyone’s research & development.

It is open source. Contribute! Fork! Guide the project! Prioritize features!

Free to try, develop, deploy to production.

Growing community.

Supported by AWS, Microsoft, IBM.

CaaS (Container as a Service) is now a real possibility.

Docker.com

Gives developers the freedom to define environments, and create and deploy apps faster and easier, and flexibility for IT ops to quickly respond to change.

Enables developers to own all the code, from infrastructure to app, and the manageability for IT ops to standardize, secure and scale the operating environment.

Gives you choice without complexity, from a laptop to a team, to private infrastructure and public cloud providers.

Allows you to compose your application from microservices, without worrying about inconsistencies between development and production.

Design the entire cycle of application development, testing and distribution, and manage it with a consistent user interface.

Offers you the ability to deploy scalable services, securely and reliably, on a wide variety of platforms.

VM Comparison

Unlike the virtual machines, which have a hypervisor layer and require a full guest operating system, docker containers have a managment layer that is the Docker engine and no guest operating system, meaning they share the features of the underlying host operating system.

As it is immediately obvious, containers within a single operating system are much more efficient, with regard to the system resources.

Virtual machines must run an entire separate operating system to get resource and security isolation, and the startup times due to this are consequently slow. They consume more memory and more disk than necessary for the application to function.

VMs can run an entirely different operating system, and of course a container cannot. VMs are heavy whereas containers are light.

Containers now offer the same features as VMs, but with minimal overhead. Their fast launch means they can run when requests start coming as opposed to having them always on like VMs.

Pricing

Free for on-premise. Azure/AWS (VM pricing). CaaS (enterprise pricing).
Demo!

Docker on Windows10

Code (PowerShell)

Information about the Windows version. This is Windows PowerShell specific part and unrelated to Docker.

[System.Environment]::OSVersion.Version

Docker version information.

docker version

Docker network information. List of all, and the details of one.

docker network ls
docker network inspect bridge

Docker images. First there are none. Then we download the hello-world image from the official Docker repository. Then we force delete of the image, and show that there are no more images locally.

docker images
docker run hello-world
docker images
docker rmi -f hello-world
docker images

Are you still here?

You can reach me on — Twitter | LinkedIn, as well as right here on Medium.

Let me know what you loved, what you hated, what left you unimpressed and what you want to know more about.

Until next time…

~ S

Kovacevic, Sasa
Solution Architect — implementing mobile, cloud and enterprise solutions.

“I’m open to all brief and to the point communications, especially those communiques that solicit my playful spirit, love of change and innovation, grand visions and ballsy ideas. I love learning from other, teaching others, writing is my passion and I am not afraid of public speaking.”

--

--