Its runs on my laptop/computer :)
We often hear developers say, “But it runs perfectly on my computer” while it doesn’t behave expectedly in production.
Scaling applications is expensive. Adding more Virtual Machines (VMs) can be expensive.
Lets say, our application requires integrating different services e.g Elastic Search. Should every developer install Elastic Search and all databases (e.g postgres) on their laptop?
Docker is a tool designed to make it easier to create, deploy, and run applications by using containers.
Docker enables developers to easily pack, ship, and run any application as a lightweight, portable, self-sufficient container, which can run virtually anywhere.
Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package.
There are three main concepts regarding Docker
Docker is a technology that allows you to incorporate and store your code and its dependencies into a neat little package - an image.
A docker image holds your source code and the dependencies it needs. Lets say you have a Dot Net app, A docker image of your app will contain the code + the libraries and everything that’s needed to run your Dot Net application.
A Dockerfile is a text file that contains a bunch of instructions which informs Docker how the Docker image should get built.
Here is an Angular project. Take a look at different Dockerfiles in the root folder. A different dockerfile for each environment.
A Node.js Dockerfile
Docker has been designed in a way that it can be incorporated into most DevOps applications, including Puppet, Chef, Vagrant, and Ansible, or it can be used on its own to manage development environments.
Agile and CI / CD practices are very easy to implement in a docker environment.
The performance difference b/w Containers and VMs is 26:1.
Although Docker is the most popular container technology, but there many other container solutions out there:
Like any other element of your IT infrastructure, containers need to be monitored and controlled. Otherwise, you literally have no idea what’s running on your servers.
That is where Orchestration comes in. There are 3 big players.
Docker Swarm, Kubernetes (built by Google), and Mesosphere (used by Twitter). Today, these are all still around, but Kubernetes is by far the most dominant cloud-orchestration program.
Kubernetes (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications.
“Designed on the same principles that allows Google to run billions of containers a week, Kubernetes can scale without increasing your ops team.”
We live on an island surrounded by a sea of ignorance. As our island of knowledge grows. so does the shore of our ignorance. ~ John Archibald Wheeler
AWS Fargate. Just build apps and Amazon will manage the containers for you (scale automatically).
With AWS Fargate, there are no upfront payments and you only pay for the resources that you use.
Microservices are an architectural approach to building applications.
The benefit to using microservices is that development teams are able to rapidly build new components of apps to meet changing business needs.
Microservices can communicate with each other, usually statelessly, so apps built in this way can be more fault tolerant.
Microservices can be written in different languages depending on the use case and requirement. Modern application development essentially consists of composing an application from a variety of services.
When you want best speed. Docker containers have less overhead than virtual machines. But Docker does not have zero overhead. The only way to get true bare-metal speed from an application is to run it directly on a bare-metal server, without using containers or virtual machines.
Docker also creates new security challenges — such as the difficulty of monitoring so many moving pieces within a dynamic, large-scale Docker environment.
All the data stored inside a container will be lost forever once the container shuts down. Managing stateful applications in a docker environment is hard.
You have to think of ways to save your data somewhere else first. To keep data safe in Docker, you need to employ an additional tool – Docker Data Volumes. Yet, this solution is still quite clumsy and needs to be improved.
Thank You!
Link to slides: https://slides.com/alamgirqazi/docker-microservices
link to blog: https://alamgirqazi.github.io/tech-blog/docker-microservices/