Does it matter
for Java Dev?
● happy father
● SA in EPAM Systems
● Java is a primary language
● hands-on-coding with Groovy, Ruby
● exploring FP with Erlang/Elixir
● passionate about agile, clean code and devops
Agenda
● what is docker?
● how to
● dev env
● demo
● summary
● q&a
Docker https://www.docker.com/
Docker - An open platform for distributed
applications for devs and ops.
● Develop an app with any programming language and any
toolchain
● Ship the “Dockerized” app and dependencies anywhere
● Scale, move between data centers, update with zero
downtime and more
1.8.3
released
Virtualization
Containerisation
Virtualization vs Containerisation
Container under the hood
Running containers
Installation
# apt-get update
# wget -qO- https://get.docker.com/ | sh
Command Line
$ docker images
$ docker pull webdizz/baseimage-java8
$ docker run -d --name=java8 webdizz/baseimage-java8
$ docker ps
$ docker logs java8
$ docker stop java8
$ docker start java8
$ docker top java8
$ docker build -t webdizz/baseimage-java8 .
Dockerfile
FROM 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
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
● 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
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://docs.docker.com/release-notes/
● https://hub.docker.com/
● https://github.com/webdizz/web-scale-perf-testing
References
Q&A
Izzet_Mustafayev@EPAM.com
@webdizz webdizz
izzetmustafaiev
http://webdizz.name
Thanks

[Szjug] Docker. Does it matter for java developer?