Docker for everything
-
Upload
timhaak -
Category
Technology
-
view
236 -
download
2
description
Transcript of Docker for everything
![Page 1: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/1.jpg)
for full stack development
![Page 2: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/2.jpg)
orVagrant is so last year
Why aren't you using
docker yet?
![Page 3: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/3.jpg)
Who am I
Tim Haak@[email protected]://github.com/timhaakphpsa2014_docker_talk
Company: AfrihostWhat I do: Bit of everything from server to frontend
![Page 4: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/4.jpg)
WarningThis presentation may contain pictures of cats!!
![Page 5: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/5.jpg)
First what is docker?
![Page 6: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/6.jpg)
In simple terms it’s a easy way to
create containerized Linux based applications
![Page 7: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/7.jpg)
Without the overhead of virtualization
![Page 8: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/8.jpg)
Why is everyone talking about it
![Page 9: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/9.jpg)
It solves a couple basic problems
![Page 10: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/10.jpg)
Simple deployment
• Matter of seconds to start and image – Same speed as starting the programs inside the
image• Central repository for images– Similar to github– Public, Private and self hosted available
![Page 11: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/11.jpg)
Simple deployment
• Can start multiple copies quickly• Simple rollback – With in reason
• Oh and versioning
![Page 12: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/12.jpg)
Repeatability
• You can test the exact image that you will run on the server
• Allows for simpler testing• There is no difference between testing and dev.
• It should remove but it worked on my pc excuse• Documented install steps – Stops the I can’t remember what’s installed on this
server
![Page 13: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/13.jpg)
Simpler to scale
• You can simply move multiple containers on one server to many
• If you follow best practices– This should be obvious but we all know how it
goes• Allows you to run multiple flavors and versions
of Linux on one server.
![Page 14: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/14.jpg)
Ok but what are the problems?
![Page 15: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/15.jpg)
Only for Linux
• Personally don’t have a problem with this
![Page 16: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/16.jpg)
More moving parts
• Can add complication compared to running a single server• But more than makes up for it as you scale
• Not as simple as just logging into a server to check how its working
![Page 17: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/17.jpg)
Not for everything
• Would not use it for larger critical DB’s– You generally want to be a close to the metal as
possible• Though great for you local development DB– Though needs to be smaller than 10G– There are workarounds for this.
![Page 18: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/18.jpg)
Biggest problem
• It works slightly differently and people will have to learn something new.
• Worth it once all the pieces are in place.
![Page 19: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/19.jpg)
Demo Time
![Page 20: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/20.jpg)
Install Docker
• Get Ubuntu 12.04/14.04– Or flavor of choice
• Follow how to on dockers site– https://docs.docker.com/
• Done– Very good documentation
![Page 21: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/21.jpg)
But I'm on Mac or Windows
• Vagrant–http://www.vagrantup.com/
• Boot2Docker–https://github.com/boot2docker
![Page 22: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/22.jpg)
But I thought you said vagrant was so last year
![Page 23: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/23.jpg)
I lied
![Page 24: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/24.jpg)
Its great to get a basic system up and running.
But that’s where you should stop.
![Page 25: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/25.jpg)
Etcd
• Simple, curl-able API (HTTP + JSON)• Optional SSL client cert authentication• Benchmarked 1000s of writes/s per instance• Properly distributed using Raft protocol
![Page 26: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/26.jpg)
Etcd
• Keys support TTL• Atomic test and set• Easily listen for changes to a prefix via HTTP
long-polling
![Page 27: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/27.jpg)
Initial System
![Page 28: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/28.jpg)
Once container has started
![Page 29: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/29.jpg)
Some tips
• Separate your programs• Don't repeat step build a base image• Store persistent data externally• Build containers to be thrown away• Put all the steps in the Docker file• Use env variables
![Page 30: Docker for everything](https://reader035.fdocuments.in/reader035/viewer/2022062419/5582fc67d8b42a32168b5394/html5/thumbnails/30.jpg)
Questions