Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Dockerize your Grails!
Iván López - @ilopmar
➢ Iván López @ilopmar
➢ Groovy & Grails developer
➢ @madridgug coordinator
➢ @greachconf organizer
http://greachconf.com
➢...
1.
Problems
If there was
another way...
Please, kill me to
end my pain!
2.
Docker
Basics about Docker
➢ Portable runtime for the app
➢ Run each app in its own isolated container
➢ Eliminate concerns about...
Hypervisor
Host OS
Server
VM
App
A
Guest
OS
Bins/
Libs
App
A'
Guest
OS
Bins/
Libs
App
B
Guest
OS
Bins/
Libs
Docker
Host OS...
$ docker run --rm ubuntu echo “Hello Greach!”
Hello Greach!
Basics
$ docker run --rm java:9 java -version
openjdk version "9-internal"
OpenJDK Runtime Environment (build 9-internal+0-2016-0...
Create image
FROM nginx:1.9.12
COPY index.html /usr/share/nginx/html/
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
Dockerf...
$ docker build -t greach .
Sending build context to Docker daemon 3.072 kB
Step 1 : FROM nginx:1.9.12
---> 6dde4f9ae735
St...
$ docker run --rm -p 1234:80 greach
Running our image
$ docker run -it -p 1234:80 greach
Running our image
3.
Grails & Docker
What if a new team member...
➢ Install Docker
➢ Clone the repo
➢ Run script
➢ Profit!
Our application
Producer Consumer
Debian 8 Java 8 RabbitMQ 3.6 Postgres 9.4Grails 3.1.4
Two options
The easy way
One image to rule them all
The easy way
➢ Everything installed on the same container
➢ More than one process per container (!!)
➢ Easy to maintain an...
Two options
The flexible way
Orchestration to the rescue
The flexible way
➢ Each application in different container
➢ Only one process per container
➢ More complicated to maintain...
4.
Demo
5.
Summary
Summary
Easy to start being
productive
Developers have the
exact environment
Control the exact
version of everything
Orche...
Thank you!
Questions?
http://bit.ly/greach-docker
@ilopmar
lopez.ivan@gmail.com
https://github.com/ilopmar
Iván López
Greach 2016   dockerize your grails
Greach 2016   dockerize your grails
Greach 2016   dockerize your grails
Greach 2016   dockerize your grails
Greach 2016   dockerize your grails
Greach 2016   dockerize your grails
Greach 2016   dockerize your grails
Upcoming SlideShare
Loading in …5
×

Greach 2016 dockerize your grails

1,547 views

Published on

The containers and particularly Docker have been one of the buzzwords of the last years, but do they offer what they promise?
In this talk will see a very quick an basic Docker 101 introduction and then will see how we can take advantages of all its features for developing and deploying our Grails applications.

Published in: Technology

Greach 2016 dockerize your grails

  1. 1. Dockerize your Grails! Iván López - @ilopmar
  2. 2. ➢ Iván López @ilopmar ➢ Groovy & Grails developer ➢ @madridgug coordinator ➢ @greachconf organizer http://greachconf.com ➢ Speaker: SpringOne 2GX, GR8Conf, GGX, Codemotion, GeeCon, jDays, Spring IO, Greach, RigaDevDay, ConFess,... About me...
  3. 3. 1. Problems
  4. 4. If there was another way... Please, kill me to end my pain!
  5. 5. 2. Docker
  6. 6. 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
  7. 7. Hypervisor Host OS Server VM App A Guest OS Bins/ Libs App A' Guest OS Bins/ Libs App B Guest OS Bins/ Libs Docker Host OS Server Bins/Libs Container Bins/Libs VM vs Docker A p p A A p p A' A p p B A p p B' A p p B' A p p B'
  8. 8. $ docker run --rm ubuntu echo “Hello Greach!” Hello Greach! Basics
  9. 9. $ docker run --rm java:9 java -version openjdk 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
  10. 10. 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
  11. 11. $ 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
  12. 12. $ docker run --rm -p 1234:80 greach Running our image
  13. 13. $ docker run -it -p 1234:80 greach Running our image
  14. 14. 3. Grails & Docker
  15. 15. What if a new team member... ➢ Install Docker ➢ Clone the repo ➢ Run script ➢ Profit!
  16. 16. Our application Producer Consumer Debian 8 Java 8 RabbitMQ 3.6 Postgres 9.4Grails 3.1.4
  17. 17. Two options The easy way One image to rule them all
  18. 18. The easy way ➢ Everything installed on the same container ➢ More than one process per container (!!) ➢ Easy to maintain and use ➢ Focused only on development
  19. 19. Two options The flexible way Orchestration to the rescue
  20. 20. The flexible way ➢ Each application in different container ➢ Only one process per container ➢ More complicated to maintain ➢ More flexible and ready for other environments
  21. 21. 4. Demo
  22. 22. 5. Summary
  23. 23. Summary Easy to start being productive Developers have the exact environment Control the exact version of everything Orchestration is more complicated But it's more powerful Everyone is happy
  24. 24. Thank you! Questions? http://bit.ly/greach-docker @ilopmar lopez.ivan@gmail.com https://github.com/ilopmar Iván López

×