Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Intro to Docker

Intro to Docker

A whirlwind peek into containerization

Rupak Ganguly

October 16, 2018

More Decks by Rupak Ganguly

Other Decks in Technology


  1. WHAT IS DOCKER? An open platform for building, shipping and

    running distributed applications inside containers. The platform consists of: The Docker Engine: a portable, lightweight runtime and packaging tool. It is the CLI that we interact with. The Docker Hub: A public/private registry for docker images, supporting sharing, and automatic builds. If it works on your machine, it will work anywhere. ensures repeatability removes dependency hell promotes portability
  2. “ Annual revenue is expected to increase by 4x, growing

    from $749 million in 2016 to more than $3.4 billion by 2021, representing a compound annual growth rate (CAGR) of 35 percent. - 451 Research
  3. DOWN THE MEMORY LANE Containers date back to 2000, FreeBSD

    Jails Solaris had similar concept called Zones Based on OpenVZ and LXC (Linux containers) Solomon Hykes stared Docker in France as an internal project with dotCloud Docker was first announced to public at PyCon in 2013 Docker is built on top of LXC & linux kernel facilities like cgroups and namespaces. Docker v0.9 dropped LXC and replaced it with libcontainer library
  4. CONTAINERS (portable) share the linux kernel & system/OS resources app

    code isolated and sandboxed very fast sub sec. startup VM HYPERVISORS (Hyper-V, KVM, Zen) are based on emulating virtual hardware pack a lot of fat that is unnecessary slow to start up VS CONTAINERS vs. VMs
  5. CONTAINERIZED APPLICATION It’s like sending a zip file of your

    document and image files rather than sending those along with OS on your machine. VMs include a full guest OS with its own memory management, device drivers, etc., while containers just have the app, bins, libs & its dependencies. Containers run as an isolated process on the host OS, and share the kernel with other containers. Containers are more portable and efficient than VMs. Containers can run on any OS or cloud. VMs can use different operating systems or kernels. All containers must use the same operating system and kernel.
  6. COMPOSING MULTI-SERVICE APPLICATIONS # docker-compose.yml version: "3" services: wp: image:

    wordpress ports: - 8080:80 # host_port:container_port environment: WORDPRESS_DB_PASSWORD: pass@word01 WORDPRESS_DB_NAME: wordpress depends_on: - mysql mysql: image: mysql:5.5 environment: MYSQL_ROOT_PASSWORD: pass@word01 ports: - 3306:3306
  7. ORCHESTRATION Develop multi-container applications locally with either Docker Swarm or

    Kubernetes and run them in production Use Docker Compose to compose full multi-service applications
  8. DEMO Simple linux shell (busybox) Dev environments (ruby,nodejs,python) Single container

    application (hello-world) Multi-container application (wordpress + mysql db)
  9. USE CASES Developer Productivity: Maintain multiple development environments on the

    host machine - Ruby, Python, Go, Node.js. Isolates environment without polluting the host machine Build & test composable, multi-microservices based applications locally. Shareability: Shared images via container public/private registries - DockerHub, Quay, AWS ECR Code Pipeline Management: Disposable build environments for CI/CD pipelines: CircleCI, Codeship, GitLab, Codefresh, TeamCity, Jenkins, TravisCI, GoCD, Docker Enterprise Edition Simplified Configuration Management decouples infrastructure requirements from application environment Rapid Deployment: Repeatable, identical environments - dev, stage, test and production App Isolation: Immutable, layered, version-tracked, reusable container images - run multiple versions of same software Multi-tenancy: Easy and inexpensive to create isolated environments for running multiple instances of app tiers for each tenant Infrastructure Consolidation & Cost Savings: Docker provides far denser server consolidation than you can get with VMs.
  10. CONTAINER PLATFORMS Docker Enterprise Amazon ECS & EKS, Google K8s

    Engine (GKE), Azure Container Service (ACS) & K8s Service (AKS) RedHat OpenShift CoreOS Tectonic Mesosphere Cloud Foundry Joyent Triton