Docker Oxford launch - Introduction to Docker

27
Docker Oxford Welcome! #DockerOxford

Transcript of Docker Oxford launch - Introduction to Docker

Page 1: Docker Oxford launch - Introduction to Docker

Docker OxfordWelcome!

#DockerOxford

Page 2: Docker Oxford launch - Introduction to Docker

Introduction to Docker2015-09-10

Jonatan Bjork DevOps Engineer @jonatanblue

Page 3: Docker Oxford launch - Introduction to Docker

Thanks John!

(and your company, Reqiva)

Page 4: Docker Oxford launch - Introduction to Docker

What is Docker?An open-source project that automates the deployment

of applications inside software containers

Page 5: Docker Oxford launch - Introduction to Docker

Sounds a lot like VM to me…

VM hypervisors (such as Hyper-V, KVM, and Xen) are all based on emulating hardware. That makes them fat in terms of system requirements.

Containers use shared operating systems. Instead of virtualising hardware, containers rest on top of a single Linux instance.

Page 6: Docker Oxford launch - Introduction to Docker

Why do we like that?

When using containers you can leave behind the useless 99.9% VM junk, leaving you with a small,

neat capsule containing your application.

Page 7: Docker Oxford launch - Introduction to Docker

I don’t need DockerI can do all that stuff with LXC tools, rsync + some

scripts!

true on all accounts

but it's also true for apt, dpkg, rpm, yum, …

the whole point is to commoditise

to make it ridiculously easy to use

Page 8: Docker Oxford launch - Introduction to Docker

What is Doxford?

Docker Oxford is a place to learn about Docker and containers.

We are developers, sysadmins and ops and software engineers, working with containers to build and deliver better software.

Page 9: Docker Oxford launch - Introduction to Docker

I’m ready to try it!

docker.com/toolbox

Page 10: Docker Oxford launch - Introduction to Docker

on Linux…docs.docker.com/linux/started/

# curl do_you_trust_me.sh | bash

# apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D # echo “deb https://apt.dockerproject.org/repo ubuntu-trusty main” > /etc/apt/sources.list.d/docker.list# apt-get update # apt-get purge lxc-docker*# apt-get install docker-engine

or

orgithub.com/docker-oxford/docker-systems

Page 11: Docker Oxford launch - Introduction to Docker

Docker on your machine• Docker client - CLI you issue commands to • Docker daemon - Service running in the

background, responsible for pulling images, running containers and streaming input/output from/to the client

Page 12: Docker Oxford launch - Introduction to Docker
Page 13: Docker Oxford launch - Introduction to Docker

Images & Containers• Image

An ordered collection of root filesystem changes - typically a union of layered filesystems stacked on top of each other. Images are read only.

• Container A container is a runtime instance of a docker image. Consists of: - A Docker image - Execution environment - A standard set of instructions

Page 14: Docker Oxford launch - Introduction to Docker
Page 15: Docker Oxford launch - Introduction to Docker

Building an image• Dockerfile - a text document that contains all the

commands you would normally execute manually in order to build a Docker image

Page 16: Docker Oxford launch - Introduction to Docker

Building an image

Page 17: Docker Oxford launch - Introduction to Docker

Committing an imageIf you make changes to a container, you can commit those changes by creating a new image from that state!

Page 18: Docker Oxford launch - Introduction to Docker

Shipping an image• Locally - you can build the image on the same

machine as you run it on. That way the image is instantly accessible after it’s been built.

• Registry - the more scalable way to ship images is to use a registry - it’s basically a third machine that acts as an image store. You build the image on one machine, push it to the registry, and pull it down to all other machines that want to run containers from that image. The most famous registry is hub.docker.com

Page 19: Docker Oxford launch - Introduction to Docker

Shipping an image: locally

Page 20: Docker Oxford launch - Introduction to Docker

Shipping an image: tar

Page 21: Docker Oxford launch - Introduction to Docker

Shipping an image: registry

Page 22: Docker Oxford launch - Introduction to Docker

Live recorded demo.

Page 23: Docker Oxford launch - Introduction to Docker

Docker Hack Day• Anything Docker-related • Submit idea + find a team (we can help you do

that) • Join us at the Hatch on Saturday 19th September

for a day of coding • Details on the Meetup page

Page 24: Docker Oxford launch - Introduction to Docker

Requests• Docker cases in production • Drone for continuous integration • Anyone using Registry? Nope. • Can you use AutoScaling with Docker?

Page 25: Docker Oxford launch - Introduction to Docker

Ack.

- James Bottomley explains the difference between containers vs. VMs really well.

- Docker glossary explains everything: http://docs.docker.com/reference/glossary/

- Matt Jaynes (@nanobeep on Twitter) provides excellent guidance in combating complexity

Page 26: Docker Oxford launch - Introduction to Docker

Q&A• What’s the benefit of using -v over committing everything to the image? —> -v

allows you to from the host share SSL certs, passwords, things you (may) want to change independently of your container — anything you need to get out to

make the container stateless. • You can use —format when doing docker inspect • Production use case 1: On AWS with RDS (postgres), ElasticSearch, Nginx

using Docker Compose (a YAML file that describes links between containers) • Production use case 2: RESTful API spawning containers for processing videos • Can you link multiple containers? —> Yes, with Compose • RancherOS — dockerised version of Linux • Dokku - Heroku in a box • Openshift - Runs SELinux • Mesos — post article with diff Kubernetes • If you have to log in to a container and change stuff you’re probably doing it

wrong… • Docker newsletter is useful

Page 27: Docker Oxford launch - Introduction to Docker

Ideas for future talks.• Using Docker as a provider for Vagrant • Docker Compose, Swarm and Machine • Docker good ideas and misconceptions • Docker security (sharing machines, verifying images,

patching) • Logging and monitoring • Docker platform as a service

Please contact us if you want to give a talk on any of these topics! meetup.com/docker-oxford