Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Docker
Dockerize all the things!
What is Docker
● Created by Solomon Hykes and owned by Docker Inc
● Abstracts hardware and allows codebases to be shipped ...
The Case for Docker
● Docker images describes all hardware dependencies for that codebase (e.g.
automake, libmysqlclient-d...
Images versus Containers
● One image can have many running containers
● An image is the source for your code and its depen...
Installing Docker
● https://docs.docker.com/engine/getstarted/step_one/
docker run hello-world
● Docker checks for the ima...
Running a Docker image
docker run docker/whalesay cowsay boo
● docker is the shell command
● run starts a container from a...
The Dockerfile
● The building blocks for your application’s image.
● Includes many common tasks like COPY, RUN, USER, ENV
...
Interactive - Creating a Dockerfile
● mkdir mydockerbuild
● cd mydockerbuild
● Create a file named “Dockerfile” and insert...
Interactive - Running Your Image
docker run docker-whale
● This is the new image we just built
● Fortunes is a shell comma...
Getting Help
● Most docker commands follow the convention:
docker <command> <args>
● You can get help by passing --help as...
Sharing a Docker Image
● Images can be (and many are) shared via Docker Hub.
● Images can be pulled similar to git reposit...
Docker Usage at Influence Health
● Influence Health has a private Docker Hub account where we host our
Dockerized applicat...
Upcoming SlideShare
Loading in …5
×

Docker presentation

168 views

Published on

An introduction to Docker, interactive examples, and how its used at Influence Health

Published in: Technology
  • Login to see the comments

  • Be the first to like this

Docker presentation

  1. 1. Docker Dockerize all the things!
  2. 2. What is Docker ● Created by Solomon Hykes and owned by Docker Inc ● Abstracts hardware and allows codebases to be shipped inside a “container” ● Containers are the successor to Virtual Machines. Docker utilizes low level kernel resources including cgroups and namespaces to be more efficient than virtual machines. ● Isolated, but native access to network, file systems, CPU, memory. Docker container PIDs start with “1” ● Uses libcontainer (replacing LXC) on Linux, Hyper-V on Windows, xhyve on OS X
  3. 3. The Case for Docker ● Docker images describes all hardware dependencies for that codebase (e.g. automake, libmysqlclient-dev, openssl, ruby, etc) ● Aids in simple deployments. You pull down an image, and run a container. It has no other setup. ● Becoming the industry standard - used by Cisco, Google, IBM, Microsoft, Red Hat, etc
  4. 4. Images versus Containers ● One image can have many running containers ● An image is the source for your code and its dependencies. Think of it as your Virtual Machine image ● A container is a running instance of your image. For example, Persuade is actually 4 app servers, and a background jobs server. These are all the same image, but we have five containers with two different role configurations* ● Docker allows you to scale easily by just running more containers *Persuade is not yet Dockerized. This is an example of how it could work.
  5. 5. Installing Docker ● https://docs.docker.com/engine/getstarted/step_one/ docker run hello-world ● Docker checks for the image, sees it is not available locally, and fetches it ● Docker then runs a container from the image ● The container writes a message to your terminal, and exits
  6. 6. Running a Docker image docker run docker/whalesay cowsay boo ● docker is the shell command ● run starts a container from an <image> ● docker/whalesay is the image name ● cowsay is a shell command INSIDE the image ● boo is an argument to cowsay ● (try other arguments for cowsay)
  7. 7. The Dockerfile ● The building blocks for your application’s image. ● Includes many common tasks like COPY, RUN, USER, ENV ● Scripts how you prepare your application’s dependencies. If you need MySQL drivers to talk to the database, you first need to install the developer library for your OS. This might look like: RUN apt-get install ... ● If you need to add a user to run your application as, it might look like: RUN adduser app
  8. 8. Interactive - Creating a Dockerfile ● mkdir mydockerbuild ● cd mydockerbuild ● Create a file named “Dockerfile” and insert: FROM docker/whalesay:latest RUN apt-get -y update && apt-get install -y fortunes CMD /usr/games/fortune -a | cowsay ● Try and build your container: docker build -t docker-whale .
  9. 9. Interactive - Running Your Image docker run docker-whale ● This is the new image we just built ● Fortunes is a shell command that returns a random fortune ● The result of fortunes is set into cowsay ● The docker image whale_say adds a graphic to cowsay
  10. 10. Getting Help ● Most docker commands follow the convention: docker <command> <args> ● You can get help by passing --help as an argument. E.g. docker --help docker build --help
  11. 11. Sharing a Docker Image ● Images can be (and many are) shared via Docker Hub. ● Images can be pulled similar to git repositories, or run from a local copy ● Docker provides a “hub” for all images at hub.docker.com . ● You can pull any public image, and even host images if you sign up for a free account.
  12. 12. Docker Usage at Influence Health ● Influence Health has a private Docker Hub account where we host our Dockerized applications. ● Marketing automation, Jenkins, and Huey are all Dockerized applications ● Other teams make extensive use of Docker in their microservices ● We plan to utilize Docker extensively going forward as we embrace services and make small, focused applications that are easy to deploy

×