RIDING THE NEXT WAVE:
DOCKER Containers
@KendrickColeman
Slideware courtesy of Docker
Why Docker?
Why docker?
WHY DOCKER?
WHY Docker?
WHY DOCKER?
Why Docker?
Why Docker?
Why Developers Care
- Build once... run anywhere
- A clean, safe, hygienic and portable runtime environment for your app.
- No worries about missing dependencies, packages and other pain points during subsequent deployments.
- Run each app in its own isolated container, so you can run various versions of libraries and other dependencies for each app without worrying
- Automate testing, integration, packaging…anything you can script
- Reduce/eliminate concerns about compatibility on different platforms, either your own or your customers.
- Cheap, zero-penalty containers to deploy services? A VM without the overhead of a VM? Instant replay and reset of image snapshots? That’s the power of Docker
Why DevOps Care
- Configure once... run anything
- Make the entire life-cycle more efficient, consistent, and repeatable
- Increase the quality of code produced by developers.
- Eliminate inconsistencies between development, test, production, and customer environments
- Support segregation of duties
- Significantly improves the speed and reliability of continuous deployment and continuous integration systems
- Because the containers are so lightweight, address significant performance, costs, deployment, and portability issues normally associated with VMs
Containers vs VMs
docker workflow
- Find a base image from registry.hub.docker.com
docker pull <image name>
Docker Workflow
- build your application from that image
- commit the container to a new image
docker commit <container id> user/image
- push the image to the docker registry (public or private)
docker push user/image
Docker Workflow
- The image in the repository can be deployed anywhere
Docker links
- Applications are rarely monolithic
- App, Web, & DB
- Create containers, expose ports, and link them
docker run -d --name docker_mysql -p 3306:3306 -e MYSQL_PASS="87654321" tutum/mysql
docker run --name docker_wordpress01 --link docker_mysql:mysql -e WORDPRESS_DB_USER="admin" -e WORDPRESS_DB_PASSWORD="87654321" -e WORDPRESS_DB_NAME="docker_wordpress01" -p 8080:
80 -d wordpress
Dockerfile
- Like a Chef Cookbook but for creating Docker containers
FROM ubuntu:trusty MAINTAINER Fernando Mayo <fernando@tutum.co>, Feng Honglin <hfeng@tutum.co> # Install packages RUN apt-get update RUN DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server-5.6 pwgen # Remove pre-installed database RUN rm -rf /var/lib/mysql/* # Add MySQL configuration ADD my.cnf /etc/mysql/conf.d/my.cnf ADD mysqld_charset.cnf /etc/mysql/conf.d/mysqld_charset.cnf # Add MySQL scripts ADD create_mysql_admin_user.sh /create_mysql_admin_user.sh ADD import_sql.sh /import_sql.sh ADD run.sh /run.sh RUN chmod 755 /*.sh # Exposed ENV ENV MYSQL_PASS **Random** # Add VOLUMEs to allow backup of config and databases VOLUME ["/etc/mysql", "/var/lib/mysql"] EXPOSE 3306 CMD ["/run.sh"]
- Tutorial - http://blog.flux7.com/blogs/docker/docker-tutorial-series-part-3-automation-is-the-word-using-dockerfile
docker projects to watch
-
Kubernetes from Google
- an open source implementation of container cluster management
- Helios from Spotify
- orchestration platform for deploying & managing containers across a fleet
- Centurion from NewRelic
- Takes containers from a Docker registry and runs them on a fleet of hosts with the correct environment variables, host volume & port mappings
- Solumn for OpenStack
- Convert code into a managed application running on an OpenStack cloud
- Clocker from Apache Brooklyn
- Contains Brooklyn entities, locations and examples that create a Docker cloud infrastructure
- libswarm from Docker
- defines a standard interface for services in a distributed system to communicate with each other
- libchan from Docker
- networking library which lets network services communicate in the same way that goroutines communicate using channels
ecosystem startups
DOCKER CONTAINER HOSTING
- stackdock.com - Docker hosting on blazing fast dedicated infrastructure
- orchardup.com - Host your Docker containers in the cloud
-
tutum.co - IaaS-like control, PaaS-like speed
PRIVATE DOCKER REGISTRY
- quay.io - Secure hosting for private Docker repositories
DOCKER PaaS
- flynn.io - The product that ops provides to developers
- deis.io - PaaS that makes it easy to deploy and manage applications
-
dokku - Docker powered mini-Heroku.
DOCKER SERVICE DISCOVERY
- skydock - Automagic Service Discovery
- docker-discover - service discovery container that leverages haproxy and etcd
LINUX ENGINEERED FOR DOCKER
- CoreOS.com - Linux for Massive Server Deployments
- ProjectAtomic.io - container-based application and service deployment with trusted operating system platforms
GET Started with Docker
- boot2docker
- Distro based on Tiny Core Linux made specifically to run Docker containers
- How to setup your Mac with VMware Fusion, Vagrant, and boot2docker (kendrickcoleman.com)
- Docker Basics
- https://docs.docker.com/articles/basics/
- Docker Command Line
- https://docs.docker.com/reference/commandline/cli/
- Docker Cheatsheet
- https://gist.github.com/wsargent/7049221
- Docker API
- How to enable Docker Remote API? (virtuallyghetto.com)
DEMO!
Docker images used:
Ubuntu (official): https://registry.hub.docker.com/_/ubuntu/
WordPress (official): https://registry.hub.docker.com/_/wordpress/
MySQL (tutum): https://registry.hub.docker.com/u/tutum/mysql/
THANK YOU!
@KendrickColeman
www.kendrickcoleman.com
Riding The Next Wave: Docker Containers
By Kenny Coleman
Riding The Next Wave: Docker Containers
This will go over some of key points you need to know to have a basic understanding of Docker
- 5,824