Giter Site home page Giter Site logo

docker-recipes's Introduction

Docker Recipes

Setup

Docker Machine

curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_darwin-amd64 > /usr/local/bin/docker-machine
docker-machine create --driver virtualbox mydocker

Application Server

Single Application Server

docker run -it -p 8080:8080 jboss/wildfly

List exact version of layers being pulled

Save Container Running State

Multiple Instances of an Application Server

  1. Create multiple machine

  2. One application server on each machine

Load Balancing

  1. Create a new machine for LB

Undertow

Apache

Persistence

This section will explain how an Application Server and a Database server can be used to deploy an application.

In-memory Database

docker run -it -p 8080:8080 arungupta/javaee7-hol

Same Host, Using Linking

docker run --name mysqldb -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_DATABASE=sample -e MYSQL_ROOT_PASSWORD=supersecret -d mysql
docker run --name mywildfly --link mysqldb:db -p 8080:8080 -d arungupta/wildfly-mysql-javaee7
docker-machine ip

Same Host, Using Compose

curl -L https://github.com/docker/compose/releases/download/1.1.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose up -d
docker-compose ps
docker-compose logs
docker-machine ip
curl http://<IP_ADDRESS>:8080/employees/resources/employees/

Persistence on Data-only Containers

docker create --name mysql_data -v /var/lib/mysql mysql
docker run --name mysqldb --volumes-from mysql_data -v /var/lib/mysql:/var/lib/mysql -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_DATABASE=sample -e MYSQL_ROOT_PASSWORD=supersecret -it -p 3306:3306 mysql

Clustering

What are the different clustering frameworks? Where do they excel? Can they work with each other? Do they need to work with each other? Pros/cons of each framework?

Framework Pros Cons

Swarm

Kubernetes

Mesos

Juju

Docker Swarm

docker run swarm create
docker-machine create -d virtualbox --swarm --swarm-master --swarm-discovery token://$TOKEN swarm-master
eval $(docker-machine env swarm-master)
docker info
docker-machine create -d virtualbox --swarm --swarm-discovery token://$TOKEN swarm-node-01
docker-machine create -d virtualbox --swarm --swarm-discovery token://$TOKEN swarm-node-02
docker-machine ls
docker info
docker ps
eval $(docker-machine env --swarm swarm-master)
docker run -it -p 8080:8080 arungupta/javaee7-hol
docker ps

Deploy Java EE application to Docker Swarm

Mesos

TBD

Juju

TBD

Application Development Tooling

IDE Pros Cons

Eclipse

NetBeans

IntelliJ

What support is offered by the three major IDEs to enable application development on Docker?

NetBeans

No support yet

Testing

How do you test applications running using Docker?

Test Java EE Applications using Arquillian Cube

PaaS

What does it take to run Docker images on PaaS?

PaaS Pros Cons

OpenShift

Amazon

Google

Amazon

Google

Full Stack

This section will explain how different components of a typical Java EE application can be setup using Docker.

Messaging

Caching

Transactions

Mail

docker-recipes's People

Contributors

arun-gupta avatar

Stargazers

Abhijit Pati avatar Daniele avatar Adnaan Badr avatar Aliaksandr Liakh avatar  avatar Domenico Giffone avatar B Manoj Kumar avatar Gunjan "Grass-fed Rabbit" Patel avatar Alexandre Malucelli avatar  avatar Alessandro Vurro avatar Hardy Ferentschik avatar Marcel Dias avatar Sigtryggur A. Árnason avatar

Watchers

 avatar James Cloos avatar  avatar  avatar

docker-recipes's Issues

using generic driver

Have you tried this script using "-d generic" instead of "-d virtualbox" ?

Thanks.

PS. This needs to be done on a Linux system.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.