What is the need to use a container like docker? Why couldn't we just have one or more dedicated machines to host services?

1/24/2017

I've entered market a few months ago. This week I started working in a new company, which uses Docker containers and Kubernetes to manage them.

I understand the concept of a container. But why to use containers over using just single or multiple machines for each service? I assume it would offer more performance and isolation. Is it because of costs issues that we don't do this?

-- sheepCow
containers
docker
kubernetes

2 Answers

1/25/2017

The most common use case for containers is to help you solve the packaging problem, so that deployment is easier. I'm heavily over-simplifying but I'm hoping to motivate the right ideas:

Normal:

  • Install dependencies on a machine
  • Pull code/binary on the machine & run

With Docker:

  • Developer puts all the dependencies and the code/binary into a docker image
  • Docker image runs anywhere as a container. Is guaranteed to work. No prior machine setup required.

With Kubernentes:

  • You don't have to manage the action of executing a run container command on a machine inside a cluster of machines.
  • As a developer you just create a cluster of machines and tell Kubernetes what container you want to run. Kubernetes figures out the best place to run your container, and runs it and then supervises it for you.

Also, you should really do this course: https://www.udacity.com/course/scalable-microservices-with-kubernetes--ud615

-- iamnat
Source: StackOverflow

1/25/2017
  1. Containers start up faster than machines
  2. Containers are lightweight so the entire image is easier to ship/replicate/backup
  3. Containers are standardized, so you can host them on-premises or in the cloud, regardless of whether it is Azure, Google, Amazon, or otherwise
  4. Containers improve the development workflow. Instead of installing software, you can simply pull down a container and run it.
  5. Containers solve environmental issues. Because all dependencies are shipped in the container, you are never stuck with "worked on my machine but fails on that one".
  6. Containers make it easier to roll out upgrades with no downtime. With a cluster of containers, you simply bring up the new version, then bring down the old.
  7. Kubernetes makes managing containers at scale easier.
  8. Kubernetes helps manage resiliency by understanding the health of a cluster of hosts to run your containers.
  9. Kubernetes simplifies access to containers by managing the lifetime for you.
-- Jeremy Likness
Source: StackOverflow