Introduction to Docker

19
Introduction to Docker Containerization is the new virtualization

description

Docker introductory slides.

Transcript of Introduction to Docker

Page 1: Introduction to Docker

Introduction to Docker

Containerization is the new virtualization

Page 2: Introduction to Docker

who

engineer and operations chapopen source chapfunny accent

(photo by Jennie Rainsford)

Page 3: Introduction to Docker

other mattersauthor

http://www.jamesturnbull.nethack-n-slash developer

https://github.com/jamtur01pontification

http://www.kartar.net

Page 4: Introduction to Docker

The Docker Book

www.dockerbook.com

Page 5: Introduction to Docker

Who are youfolks?

Page 6: Introduction to Docker

So what is Docker?Container virtualizationBuild, pack, ship and run applications as containersBuild once, run in many placesIsolated and content agnostic

Page 7: Introduction to Docker

Some history

Page 8: Introduction to Docker

So why should I care?Easy (and lightweight!) way to model realityDevs care about their app, Ops cares about the containersGolden images without the overhead

Page 9: Introduction to Docker

Why developers care...A clean, safe, hygienic and portable runtime environmentNo worries about missing dependencies, packages and other painpointsRun each app in its own isolated container, so you can run variousversions of libraries and other dependenciesAutomate testing, integration, packagingReduce/eliminate concerns about compatibility on different platforms

Page 10: Introduction to Docker

Why operations care...Make the entire lifecycle more efficient, consistent, and repeatableIncrease the quality of code produced by developersEliminate inconsistencies between development, test, and productionenvironmentsSupport segregation of dutiesSignificantly improves the speed and reliability of continuousdeployment and integration

Page 11: Introduction to Docker

So why not VMs or Cloud?Speed of deploymentPortabilitySize aka cached layering FTWDensity & PerformanceCost

Page 12: Introduction to Docker

Technology StackRuns (for now) on most Linux distroscgroups and namespacingDevice Mapper or AUFS or vfs or <pluggable in future>lxc or <pluggable in future>

Page 13: Introduction to Docker

Technology Stack

Page 14: Introduction to Docker

Docker BasicsImage

ContainerRegistry

Page 15: Introduction to Docker

Building Docker images with aDockerfile

FROM ubuntu MAINTAINER James Turnbull "[email protected]" RUN apt-get install -y apache2 ENV APACHE_RUN_USER www-data ENV APACHE_RUN_GROUP www-data ENV APACHE_LOG_DIR /var/log/apache2 EXPOSE 80 ENTRYPOINT ["/usr/sbin/apache2"] CMD ["-D", "FOREGROUND"]

Page 16: Introduction to Docker

Building the image$ sudo docker build -t="jamtur01/apache2" .

Page 17: Introduction to Docker

Pushing the image$ sudo docker push jamtur01/apache2

Page 18: Introduction to Docker

Running the container$ sudo docker run -d -p 80 -v /var/www/myapp jamtur01/apache2

Page 19: Introduction to Docker

Questions?