Using Docker to Develop, Test and Run Maven Projects - Wouter Danes

Preview:

Citation preview

Using Docker to Develop,

Test and Run Maven

Projects

Wouter Danes

ING

Full Stack Engineer

@wouterdanes

github.com/wouterd

wouterdanes.net

Agenda

• What is docker?

• Ways I use Docker for Development

• Using Docker to Scale CI

• Integrating Docker in your Build Process

• Demo app

• Wouldn’t it be great if..

What is docker?

Hai, Can I Has Rootz?

What is docker?Virtual Machines Docker Containers

Ways I use docker during development

Shadow IT

Run

“production”

locally

Proofs

of

Concept

Using Docker to Scale CI

• Spawn build slaves

• No port collisions

• Master only development

• No version / stack collisions in “environment”

Integrating Docker in your Build Process

High level build process

Docker commands per build step

Maven vs Docker

Docker Maven Plugin Zoo

• 12 github projects

• Varying focus, some better than

others

• pick the one that best fits your

purpose

• Some interesting ones:

– wouterd/docker-maven-plugin

– rhuss/docker-maven-plugin

– spotify/docker-maven-plugin

– rhuss/docker-maven-plugin

What should a maven plugin do?

• Build docker images

• Start containers

• Link containers

• Wait for containers to finish

initialisation

• Expose URLs / port info to

integration tests

• Clean up

• Push images to an index /

registry

Demo project

Wouldn’t It Be Great If..

• Every team would publish

– Application images

– Application test images

– Something describing their dependencies

– Or maybe an image that builds their

environment?

Wouldn’t It Be Great If..

• Every team would publish

– Application images

– Application test images

– Something describing or creating their dependencies

• And then you could:

– Auto-test against new dependencies?

– Auto-test dependants vs your new version?

Recommended