The problem
Imagine being approached by a friend who has an idea for a startup and you need to launch your app as quickly as possible. You've successfully completed the web app and you're ready to deploy the app but you then realize that your app is running different versions of a technology which would result in version conflicts when deployed .đ¤ Now what would you do? "Duuhđ¤ˇââď¸ deploy on several Virtual Machines". Well, possible but then what if we want to perform updates, load balancing? You don't want to be handling hosting environments, runtimes, libraries and OS needed by your application.That would be a lot of work. Enter containers !!
Containers help us deploy our apps easily. Deploying is a simple as running a new container. You can even route users to containers, and trash old onesâŚIf you want less work you can even automate those with orchestrators..
How do containers work?
Unlike virtual machines which provide hardware virtualization, a container provides OS level virtualization by isolating the software from it's environment and ensuring that it works uniformly despite differences. They make applications easier to work with.
Docker is an example of container based technology.
Let's Get Started!!
To get started with docker head over to Docker and download docker desktop for your OS (Mac, Linux or Windows)
WINDOWS
Before you install docker on windows you have to:
1. Enable Hyper-v
2. Enable hardware vitualization
Linux
Various packages exists depending on your flavour of linux. You can find post installation steps here Docker for linux
MAC
Docker Desktop need MacOs Sierra 10.12 or above.
Run a Container
NB: All commands are the same and do not differ when using a different os
After successfully installing docker desktop, run the following code in you terminal
docker run hello-world
Thatâs it: your first container. The hello-world container output tells you a bit about what just happened. Essentially, the Docker engine running in your terminal tried to find an image named hello-world. Since you just got started there are no images stored locally (Unable to find image...)
so Docker engine goes to its default Docker registry, which is Docker Store, to look for an image named âhello-worldâ. It finds the image there, pulls it down, and then runs it in a container. And hello-worldâs only function is to output the text you see in your terminal, after which the container exits.
In the next post we'll take a look at Images.
Top comments (4)
You really missed an oportunity here. Docker actually lets you create an image from scratch.
Thanks Heiker would work on that
don't worry, it was just a joke. You know, the dockerfile sintax
FROM scratch
and the title learn docker from scratch.Oh yeah đ..I just understood.
Smart!!
Some comments have been hidden by the post's author - find out more