JOSA TechTalk: Introduction to docker

27
Intro to Docker Aram Yegenian - Systems Admin

Transcript of JOSA TechTalk: Introduction to docker

Page 1: JOSA TechTalk: Introduction to docker

Intro to Docker

Aram Yegenian - Systems Admin

Page 2: JOSA TechTalk: Introduction to docker

● Who should care?● What is the problem?● What is a container?● What is Docker● Docker 101● Docker demo● Docker compose● Docker compose demo

Outline

Page 3: JOSA TechTalk: Introduction to docker

● Who should care?● What is the problem?● What is a container?● What is Docker● Docker 101● Docker demo● Docker compose● Docker compose demo

Outline

Page 4: JOSA TechTalk: Introduction to docker

Why developers care?

● Build once... (finally) run anywhere (as long as it is a Linux stack)● A clean, safe, hygienic, portable runtime environment for your app.● No worries about missing dependencies, packages and other pain points during subsequent

deployments.● Run each app in its own isolated container, so you can run various versions of libraries and other

dependencies for each app without worrying.● Automate testing, integration, packaging...anything you can script.● Reduce/eliminate concerns about compatibility on different platforms, either your own or your

customers.● Cheap, zero-penalty containers to deploy services. A VM without the overhead of a VM. Instant

replay and reset of image snapshots.

Page 5: JOSA TechTalk: Introduction to docker

Why Administrators Care

● Configure once... run anything● Make the entire lifecycle more efficient, consistent, and repeatable● Increase the quality of code produced by developers.● Eliminate inconsistencies between development, test, production, and customer environments.● Support segregation of duties.● Significantly improves the speed and reliability of continuous deployment and continuous

integration systems.● Because the containers are so lightweight, address significant performance, costs, deployment,

and portability issues normally associated with VMs.

Page 6: JOSA TechTalk: Introduction to docker

CFO, CIO, CTO, ...

● Faster Software Development Lifecycle: Development/Testing/Production● Less overhead● More consolidation● More agility● Reduced cost

Page 7: JOSA TechTalk: Introduction to docker

● Who should care?● What is the problem?● What is a container?● What is Docker● Docker 101● Docker demo● Docker compose● Docker compose demo

Outline

Page 8: JOSA TechTalk: Introduction to docker

The Challenge

Page 9: JOSA TechTalk: Introduction to docker

The Matrix From Hell

Page 10: JOSA TechTalk: Introduction to docker

Solution: Intermodel Shipping Container

Page 11: JOSA TechTalk: Introduction to docker

Docker is a shipping container for code

Page 12: JOSA TechTalk: Introduction to docker

Docker Eliminates the Matrix from Hell

Page 13: JOSA TechTalk: Introduction to docker

Why it works: Separation of concerns

Page 14: JOSA TechTalk: Introduction to docker

● Who should care?● What is the problem?● What is a container?● What is Docker● Docker 101● Docker demo● Docker compose● Docker compose demo

Outline

Page 15: JOSA TechTalk: Introduction to docker

Linux containers

Operating-system-level virtualization is a server-virtualization method where the kernel of an operating system allows for multiple isolated user-space instances, instead of just one.

On Unix-like operating systems, one can see this technology as an advanced implementation of the standard chroot mechanism.

Page 16: JOSA TechTalk: Introduction to docker

● Who should care?● What is the problem?● What is a container?● What is Docker● Docker 101● Docker demo● Docker compose● Docker compose demo

Outline

Page 17: JOSA TechTalk: Introduction to docker

What is Docker?

Docker is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of operating-system-level virtualization on Linux.

Docker uses resource isolation features of the Linux kernel such as cgroups and kernel namespaces to allow independent "containers" to run within a single Linux instance, avoiding the overhead of starting and maintaining virtual machines.

Page 18: JOSA TechTalk: Introduction to docker

More technical details

Why

● Run everywhere● Regardless of kernel version● Regardless of host distro● Physical or virtual, cloud or not● Container and host architecture must

match...

● Run anything● If it can run on the host, it can run in the

container● If it can run on a Linux kernel, it can run

What

● High level: a lightweight VM● Own process space● Own network interface● Can run stuff as root● Can have its own /sbin/init (different from

host)

● Low level: chroot on steroids● Can also have its own /sbin/init● Container = isolated processes● Share kernel with host

Page 19: JOSA TechTalk: Introduction to docker

VMs vs Conatiners

Page 20: JOSA TechTalk: Introduction to docker

Why are Docker Containers Lightweight

Page 21: JOSA TechTalk: Introduction to docker

● Who should care?● What is the problem?● What is a container?● What is Docker● Docker 101● Docker demo● Docker compose● Docker compose demo

Outline

Page 22: JOSA TechTalk: Introduction to docker

Docker 101● docker ps ● docker images● docker images ubuntu● docker run -it ubuntu /bin/bash● docker run -it ubuntu echo “hello world”● docker run -it -e FOO=bar ubuntu /bin/bash● docker run --name ubuntu_test -it ubuntu /bin/bash● docker start ubuntu_test● docker exec -it test_ubuntu /bin/bash● docker pull centos● docker run -d php:5.6-apache● docker run -v $PWD/www:/var/www/html -d -p 80 php:5.6-apache

Page 23: JOSA TechTalk: Introduction to docker

● Who should care?● What is the problem?● What is a container?● What is Docker● Docker 101● Docker demo● Docker compose● Docker compose demo

Outline

Page 24: JOSA TechTalk: Introduction to docker

Docker compose

Compose is a tool for defining and running multi-container applications with Docker. With Compose, you define a multi-container application in a single file, then spin your application up in a single command which does everything that needs to be done to get it running.

Page 25: JOSA TechTalk: Introduction to docker

Docker compose (fig)

● docker-compose -f dev.yml up -d

Page 26: JOSA TechTalk: Introduction to docker

Enterprise solutions & more

docker swarm

Google Kubernetes http://kubernetes.io/

DCHQ https://www.dchq.io

Tutum https://www.tutum.co/

Microsoft Azure - Docker

Amazon AWS

Page 27: JOSA TechTalk: Introduction to docker

Q & AThank you