Ryan Walls
@ryanwalls
Director of Software Engineering
3DSIM
Before we begin:
Download Docker for your OS
Wifi password: lucidguessed
What are solaris zones?
Agnostic build environment? Less setup.
Best practices on Dockerfiles?
Docker networking
Docker in AWS
Setup of a Safe environment
Container
Image
Engine
Hub
Uses open source container framework
https://github.com/containerd/containerd
containerd is an industry-standard container runtime with an emphasis on simplicity, robustness and portability. It is available as a daemon for Linux and Windows, which can manage the complete container lifecycle of its host system
VM
Docker container
Large
Small
Consume significant CPU and memory
Basically zero memory and CPU overhead
Not easily portable between VM environments
Run in any linux environment
Hardware centric
Application centric
An image is the source of a docker container.
Imperfect analogy:
MyClass.java -> MyClass.class -> running instance of MyClass running in JVM
Dockerfile -> docker image -> running docker container in docker enginer
Manages containers
Start/Stop
Status
Linking
Networking
Storage
Client-server application with these major components:
A server
A REST API
A command line interface (CLI) client
Store and browse ready-made docker images
Let's demo a little Docker first
Let's see what it can do... then let's talk
Instant CI server
docker run -i -t -d --name neo4j --cap-add=SYS_RESOURCE \
-p 7474:7474 tpires/neo4jTry out neo4j
docker run --name myjenkins -p 8080:8080 -v /var/jenkins_home jenkinsPlay around with nginx
docker run -p 7070:80 -v \
/path/to/some/sample-static-html:/usr/share/nginx/html:ro -d nginxHow about mongo?
docker run --name my-mongo -d mongohttps://github.com/wsargent/docker-cheat-sheet
You can create a docker image by just running commands against a base image.
docker pull learn/tutorial
docker run learn/tutorial apt-get install -y ping
docker ps -l
docker commit <id from previous step> learn/ping
docker run learn/ping ping google.com
Instead of running commands and saving, can create a Dockerfile that specifies all the commands to build an image.
FROM maven:3.3-jdk-8-onbuild-alpine
RUN mvn test
EXPOSE 8080
CMD ["java", "-jar", "target/docker-for-java-developers-0.1.0.jar"]Build the Dockerfile into an image and tag the image
docker build -t="myname/mytomcatapp:v1" .
Create a container by running the image
docker run -t -i myname/mytomcatapp:v1
"Without continuous integration, we are nothing."
-- Anonymous
https://clusterhq.com/assets/pdfs/state-of-container-usage-june-2016.pdf
Best answer early 2015...
For those who don't have Docker installed, use the in browser tutorials here:
http://training.play-with-docker.com/dev-stage1
All this child's play? Check out all the tutorials: