Top Banner
www.aurorasolutions.io Ship Java Apps with Docker!
32
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Ship java apps with docker!

www.aurorasolutions.io

Ship Java Apps with Docker!

Page 2: Ship java apps with docker!

www.aurorasolutions.io

Raise your hands if you have...

❖ Tried Docker (online tutorial)❖ Tried real Docker (e.g. deployed on remote VM)❖ Installed Docker locally (e.g. with boot2docker)❖ Written a Dockerfile (and built it!)❖ An image on Docker hub (pushed or autobuilt)❖ Deployed Docker images for dev/QA/test/prod… etc.

Page 3: Ship java apps with docker!

www.aurorasolutions.io

About: Rasheed

Full Stack Developer & Co-Founder @ Aurora Solutions - Provides REMOTE Teams specializing in JVM languages and Angular + Ember

My team at Aurora specializes in:► Web/Backend Apps ◄ Java, Groovy, Grails, C# and AngularJS/EmberJS based single or multi page web apps► Mobile Apps ◄ Android & iOS

Business domains we specialize in:¤ Media Streaming¤ Automated/Algorithmic Trading¤ Bitcoin / Crypto Currency

LinkedIn: https://se.linkedin.com/in/rasheedwaraich

Email: [email protected]

Page 4: Ship java apps with docker!

www.aurorasolutions.io

Agenda● Background● Container vs VM● Define Sample App● Build/Run Docker Images● Docker Index● Deploy Locally● Deploy AWS● Deploy GCE

Page 5: Ship java apps with docker!

www.aurorasolutions.io

Background

Page 9: Ship java apps with docker!

www.aurorasolutions.io

A useful analogy...

Page 16: Ship java apps with docker!

www.aurorasolutions.io

Say again?

❏ Build: package your application in a container❏ Ship: move that container from a machine to another❏ Run: execute that container❏ Any application: anything that runs on Linux❏ Anywhere: local VM, cloud instance, bare metal…

Page 17: Ship java apps with docker!

www.aurorasolutions.io

Container vs. VM

Page 20: Ship java apps with docker!

www.aurorasolutions.io

Basic Docker Concepts

Page 21: Ship java apps with docker!

www.aurorasolutions.io

Main Docker Parts

● docker daemon○ used to manage docker (LXC) containers on the host it runs

● docker CLI○ used to command and communicate with the docker daemon

● docker image index○ a repository (public or private) for docker images

Page 22: Ship java apps with docker!

www.aurorasolutions.io

Main Docker Elements

● Dockerfiles○ scripts automating the building process of images

● docker images○ snapshots of containers or base OS (e.g. Ubuntu) images

● docker containers○ directories containing everything-your-application

Page 23: Ship java apps with docker!

www.aurorasolutions.io

Install Docker (Ubuntu 14.04)

Step 1: add docker repository key to apt-key for package verification

sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"

Step 2: add the docker repository to your list of repositories:sudo sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"

Step 3: finally install docker with an apt-get combo:sudo apt-get updatesudo apt-get install lxc-docker

Page 24: Ship java apps with docker!

www.aurorasolutions.io

Sample java app!

Page 25: Ship java apps with docker!

www.aurorasolutions.io

Deploy Locally!

Page 26: Ship java apps with docker!

www.aurorasolutions.io

Docker Index

Page 27: Ship java apps with docker!

www.aurorasolutions.io

Docker Index❏ https://index.docker.io/

❏ It’s GitHub for Docker images!

❏ You can pull activemq, mysql, mongodb, hadoop, … etc.

❏ You can hook your docker index repository on to your own repository on GitHub!!!❏ Build images automatically once you push something to Github

Page 28: Ship java apps with docker!

www.aurorasolutions.io

Deploy on EC2!

Page 29: Ship java apps with docker!

www.aurorasolutions.io

Deploy on GCE!

Page 30: Ship java apps with docker!

www.aurorasolutions.io

Docker Linking

Page 32: Ship java apps with docker!

www.aurorasolutions.io

Thank you!Questions...