Introduction to Docker
-
Upload
james-turnbull -
Category
Technology
-
view
5.451 -
download
4
description
Transcript of Introduction to Docker
Introduction to Docker
Containerization is the new virtualization
who
engineer and operations chapopen source chapfunny accent
(photo by Jennie Rainsford)
other mattersauthor
http://www.jamesturnbull.nethack-n-slash developer
https://github.com/jamtur01pontification
http://www.kartar.net
Who are youfolks?
So what is Docker?Container virtualizationBuild, pack, ship and run applications as containersBuild once, run in many placesIsolated and content agnostic
Some history
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
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
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
So why not VMs or Cloud?Speed of deploymentPortabilitySize aka cached layering FTWDensity & PerformanceCost
Technology StackRuns (for now) on most Linux distroscgroups and namespacingDevice Mapper or AUFS or vfs or <pluggable in future>lxc or <pluggable in future>
Technology Stack
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"]
Building the image$ sudo docker build -t="jamtur01/apache2" .
Pushing the image$ sudo docker push jamtur01/apache2
Running the container$ sudo docker run -d -p 80 -v /var/www/myapp jamtur01/apache2
Questions?