Does it matter for Java Dev?
Jun 14, 2015
Does it matter for Java Dev?
● just baked father
● SA at EPAM Systems
● primary skill is Java
● hands-on-coding with Groovy, Ruby
● trying to get in touch with Erlang/Elixir
● passionate about agile, clean code and devopsIzzet Mustafayev@EPAM Systems@webdizz webdizz izzetmustafaievhttp://webdizz.name
Agenda● what is docker?
● concepts
● how to
● dev env
● demo time
● what’s next
● summary
● q&a
Docker https://www.docker.com/
Docker - An open platform for
distributed applications for
developers and sysadmins.
● Develop an app with any language and any
toolchain
● Ship the “Dockerized” app and
dependencies anywhere
● Scale, move between data centers, update
with zero downtime and more
1.6.2released
Virtualization
Containerisation
Virtualization vs Containerisation
Container under the hood
Running containers
Concepts
Automation
● Build automation● Provisioning automation ● Configuration automation● Delivery Automation
● Environment as a code ● Prohibition of ad-hoc changes
Immutability
● Build● Run ● Destroy
Disposability
Containerisation
● Container as deployment artifact● Environment agnostic● New version - new container● All dependencies built in
Installation# apt-get update
# wget -qO- https://get.docker.com/ | sh
Assumption: Ubuntu
DockerfileFROM phusion/baseimage:0.9.12
RUN apt-get -y update \
&& apt-get -y install software-properties-common python-software-
properties \
&& add-apt-repository ppa:webupd8team/java \
&& apt-get clean
RUN apt-get -y update \
&& echo oracle-java8-installer shared/accepted-oracle-license-v1-1
select true | /usr/bin/debconf-set-selections \
&& apt-get -y install oracle-java8-installer \
&& apt-get clean \
&& update-alternatives --display java
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
1
3
4
5
Command Line$ docker build -t webdizz/baseimage-java8 .
$ docker images
$ docker run -d --name=java8 \
webdizz/baseimage-java8
$ docker ps
$ docker logs java8
$ docker stop java8
$ docker start java8
$ docker top java8
Docker Hub● User accounts and Authentication
● Public namespaces
● Automated builds
● Registry for images with checksums
● Meta-data store (comments, stars, list public
repositories)
Official images
Official images for Java
Official images for Java...
● Clojure● Tomcat● Jruby● Maven● Glassfish● Elasticsearch● Jenkins● SonarQube
● And more non-official
Dev Env
Perfect together
Routine is boring
Docker-compose is our way● YAML syntax
● Configuration inclusion/inheritance
● Comprehensive CLI
● Bash completion
Docker-compose YAML● image
● command
● links
● ports/expose
● volumes
● environment
● ...
Docker-compose CLI● build
● up
● logs
● ps
● run
● start/stop
● scale
● ...
Demo Time
Service Discovery
● Configuration registry
● DNS
● Health checking
Tools
● Consul
● Etcd
● Zookeeper
Resource Management
● Scheduling
● Task execution
● Auto scale
Tools
● Mesos
● Flynn
● Fleet
Monitoring
● Failures and Outages are expected for
distributed apps
● Business aware metrics matters
Tools
● Dropwizard Metrics
● Netflix Servo
● cAdvisor
Logging
● Critical for operation
● Even more critical for distributed operation
● Remains critical with operation in Docker
Tools
● Elasticsearch Logstash Kibana
● Elasticsearch Fluentd Kibana
Continuous Delivery
● Container as deployable artifact
● New container for new application version
● Start/stop proper version of container for proper
version of application
Tools
● Ansible
● Docker Swarm
Summary ● Easy and fast building of images
● Easy to share in your team
● Easy to scale
● Easy to work with new technologies
● Of course learning curve
● Production like dev env*
● http://docs.docker.com/
● https://hub.docker.com/
● http://www.fig.sh/
● https://mesosphere.com/
● http://www.consul.io/
● https://flynn.io
● https://github.com/coreos/fleet
● http://goo.gl/NEAfF2
● http://goo.gl/gfi94z
References
Q&A
Izzet Mustafayev@EPAM Systems@webdizz webdizz izzetmustafaievhttp://webdizz.name