greach 2016 dockerize your grails
TRANSCRIPT
➢ Iván López @ilopmar
➢ Groovy & Grails developer
➢ @madridgug coordinator
➢ @greachconf organizerhttp://greachconf.com
➢ Speaker: SpringOne 2GX, GR8Conf, GGX, Codemotion,GeeCon, jDays, Spring IO, Greach, RigaDevDay, ConFess,...
About me...
Basics about Docker
➢ Portable runtime for the app
➢ Run each app in its own isolated container
➢ Eliminate concerns about compatibility on different platforms
➢ Like a VM without the overhead of a VM
➢ Lightweight than a VM
Hypervisor
Host OS
Server
VM
AppA
GuestOS
Bins/Libs
AppA'
GuestOS
Bins/Libs
AppB
GuestOS
Bins/Libs
Do
cker
Host OS
Server
Bins/Libs
Container
Bins/Libs
VM vs Docker
App A
App A'
App B
App B'
App B'
App B'
$ docker run --rm java:9 java -versionopenjdk version "9-internal"
OpenJDK Runtime Environment (build 9-internal+0-2016-01-26-172948.buildd.src)
OpenJDK 64-Bit Server VM (build 9-internal+0-2016-01-26-172948.buildd.src, mixed mode)
$ alias java="docker run --rm java:9 java"
$ java -version
Basics
Create image
FROM nginx:1.9.12
COPY index.html /usr/share/nginx/html/
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
Dockerfile
<h1>Hello Greach!</h1>
index.html
$ docker build -t greach .Sending build context to Docker daemon 3.072 kB
Step 1 : FROM nginx:1.9.12
---> 6dde4f9ae735
Step 2 : COPY index.html /usr/share/nginx/html/
---> c1c0f4eeffe4
Removing intermediate container 08fb8441e6be
Step 3 : EXPOSE 80
---> Running in 4d6151c06c9b
---> e07151354dc9
Removing intermediate container 4d6151c06c9b
Step 4 : CMD nginx -g daemon off;
---> Running in 8edd425ce757
---> ef945069377f
Removing intermediate container 8edd425ce757
Successfully built ef945069377f
Create image
The easy way
➢ Everything installed on the same container
➢ More than one process per container (!!)
➢ Easy to maintain and use
➢ Focused only on development
The flexible way
➢ Each application in different container
➢ Only one process per container
➢ More complicated to maintain
➢ More flexible and ready for other environments
Summary
Easy to start beingproductive
Developers have the exact environment
Control the exact version of everything
Orchestration is more complicated
But it's more powerful
Everyone is happy
Thank you!Questions?
http://bit.ly/greach-docker
@ilopmar
https://github.com/ilopmar
Iván López