Building Reusable Development
Environments with Docker
Harold Dost
Raastech, Inc.
CC BY 3.0 US, Harold A. Dost III 1
About Me
Harold Dost (@hdost)
7+ years of Oracle Middleware
experience
OCE (SOA Foundation Practitioner)
Oracle ACE Associate
From Michigan
blog.raastech.com
CC BY 3.0 US, Harold A. Dost III 2
About Raastech
» Small systems integrator founded in 2009
» Headquartered in the Washington DC area
» Specializes in Oracle Fusion Middleware
» Oracle Platinum Partner & Reseller
» Oracle SOA Specialized – 1 in 1,500 worldwide
» Oracle Platinum Partner – 1 in 3,000 worldwide
CC BY 3.0 US, Harold A. Dost III 3
Docker
CC BY 3.0 US, Harold A. Dost III 4
The Docker Ecosystem
CC BY 3.0 US, Harold A. Dost III 5
Tools
» Docker Machine
» Docker Engine
» Docker Compose
» Docker Registry
CC BY 3.0 US, Harold A. Dost III 6
Docker Machine
» This aids in creating docker hosts
» The target of these can be:
» Cloud Providers
» AWS
» Digital Ocean
» Google Cloud Platform
» Microsoft Azure and Hyper-V
CC BY 3.0 US, Harold A. Dost III 7
Docker Machine cont.
» Other VM Targets
» OpenStack
» Oracle VirtualBox
» VMware Fusion®
» vCloud® Air™
» vSphere®
CC BY 3.0 US, Harold A. Dost III 8
Docker Machine
Creates a dummy machine
docker-machine create --driver virtualbox default
CC BY 3.0 US, Harold A. Dost III 9
Docker Engine
» The basis of the whole docker eco system
» Responsible for handling all interactions between the
containers and the base operating system
CC BY 3.0 US, Harold A. Dost III 10
Using Docker Engine
» 39 Different commands
» Only covering some of the most used
CC BY 3.0 US, Harold A. Dost III 11
Commands: Retrieve
pull - Pull an image or a repository from a registry
CC BY 3.0 US, Harold A. Dost III 12
Commands: Create and Delete
create - Create a new container
rm - Remove one or more containers
rmi - Remove one or more images
CC BY 3.0 US, Harold A. Dost III 13
Commands: Start and Stop
start - Start 1+ stopped containers
stop - Stop a running container
exec - Run command in running container
run - Run command in new container
kill - Kill a running container
restart - Restart a running container
CC BY 3.0 US, Harold A. Dost III 14
Commands: Organize
rename - Rename a container
tag - Tag an image into a repository
commit - Create a new image from a container's changes
CC BY 3.0 US, Harold A. Dost III 15
Commands: Etc.
cp - Copy files to and from containers
port - List port mappings
ps - List containers
attach - Attach to a running container
CC BY 3.0 US, Harold A. Dost III 16
Dockerfile 1
FROM java:8
RUN apt-get update
RUN apt-get install -y maven nodejs
EXPOSE 9000
WORKDIR /app
COPY app /app
RUN chown -R appuser /app
USER appuser
ENTRYPOINT mvn spring-boot:run
1
For more information about file arguments check here.
CC BY 3.0 US, Harold A. Dost III 17
Docker Compose
» Create Multi-container Applications
» Example:
» Java App
» Database
CC BY 3.0 US, Harold A. Dost III 18
Docker Compose
» Uses decriptor file compose.yml
» Brings up an application
CC BY 3.0 US, Harold A. Dost III 19
Docker Compose Commands
build - Build or rebuild services
kill - Kill containers
up - Create and start containers
migrate-to-labels - Recreate containers to add labels
version - Show the Docker-Compose version information
CC BY 3.0 US, Harold A. Dost III 20
The docker-compose.yml 1
web:
build: .
links:
- db
ports:
- "8000:8000"
db:
image: postgres
1
For more information about file arguments check here.
CC BY 3.0 US, Harold A. Dost III 21
MAVEN Plugins
» https://github.com/spotify/docker-maven-plugin
» https://github.com/rhuss/docker-maven-plugin
» https://github.com/wouterd/docker-maven-plugin
CC BY 3.0 US, Harold A. Dost III 22
Real world Demo
CC BY 3.0 US, Harold A. Dost III 23
Using Docker Machine
CC BY 3.0 US, Harold A. Dost III 24
Using Docker Engine
CC BY 3.0 US, Harold A. Dost III 25
Running Composed
Docker Containers
CC BY 3.0 US, Harold A. Dost III 26
Perform Tests
CC BY 3.0 US, Harold A. Dost III 27
Combining Docker
with CI
CC BY 3.0 US, Harold A. Dost III 28
Questions?
CC BY 3.0 US, Harold A. Dost III 29

Building Reusable Development Environments with Docker

  • 1.
    Building Reusable Development Environmentswith Docker Harold Dost Raastech, Inc. CC BY 3.0 US, Harold A. Dost III 1
  • 2.
    About Me Harold Dost(@hdost) 7+ years of Oracle Middleware experience OCE (SOA Foundation Practitioner) Oracle ACE Associate From Michigan blog.raastech.com CC BY 3.0 US, Harold A. Dost III 2
  • 3.
    About Raastech » Smallsystems integrator founded in 2009 » Headquartered in the Washington DC area » Specializes in Oracle Fusion Middleware » Oracle Platinum Partner & Reseller » Oracle SOA Specialized – 1 in 1,500 worldwide » Oracle Platinum Partner – 1 in 3,000 worldwide CC BY 3.0 US, Harold A. Dost III 3
  • 4.
    Docker CC BY 3.0US, Harold A. Dost III 4
  • 5.
    The Docker Ecosystem CCBY 3.0 US, Harold A. Dost III 5
  • 6.
    Tools » Docker Machine »Docker Engine » Docker Compose » Docker Registry CC BY 3.0 US, Harold A. Dost III 6
  • 7.
    Docker Machine » Thisaids in creating docker hosts » The target of these can be: » Cloud Providers » AWS » Digital Ocean » Google Cloud Platform » Microsoft Azure and Hyper-V CC BY 3.0 US, Harold A. Dost III 7
  • 8.
    Docker Machine cont. »Other VM Targets » OpenStack » Oracle VirtualBox » VMware Fusion® » vCloud® Air™ » vSphere® CC BY 3.0 US, Harold A. Dost III 8
  • 9.
    Docker Machine Creates adummy machine docker-machine create --driver virtualbox default CC BY 3.0 US, Harold A. Dost III 9
  • 10.
    Docker Engine » Thebasis of the whole docker eco system » Responsible for handling all interactions between the containers and the base operating system CC BY 3.0 US, Harold A. Dost III 10
  • 11.
    Using Docker Engine »39 Different commands » Only covering some of the most used CC BY 3.0 US, Harold A. Dost III 11
  • 12.
    Commands: Retrieve pull -Pull an image or a repository from a registry CC BY 3.0 US, Harold A. Dost III 12
  • 13.
    Commands: Create andDelete create - Create a new container rm - Remove one or more containers rmi - Remove one or more images CC BY 3.0 US, Harold A. Dost III 13
  • 14.
    Commands: Start andStop start - Start 1+ stopped containers stop - Stop a running container exec - Run command in running container run - Run command in new container kill - Kill a running container restart - Restart a running container CC BY 3.0 US, Harold A. Dost III 14
  • 15.
    Commands: Organize rename -Rename a container tag - Tag an image into a repository commit - Create a new image from a container's changes CC BY 3.0 US, Harold A. Dost III 15
  • 16.
    Commands: Etc. cp -Copy files to and from containers port - List port mappings ps - List containers attach - Attach to a running container CC BY 3.0 US, Harold A. Dost III 16
  • 17.
    Dockerfile 1 FROM java:8 RUNapt-get update RUN apt-get install -y maven nodejs EXPOSE 9000 WORKDIR /app COPY app /app RUN chown -R appuser /app USER appuser ENTRYPOINT mvn spring-boot:run 1 For more information about file arguments check here. CC BY 3.0 US, Harold A. Dost III 17
  • 18.
    Docker Compose » CreateMulti-container Applications » Example: » Java App » Database CC BY 3.0 US, Harold A. Dost III 18
  • 19.
    Docker Compose » Usesdecriptor file compose.yml » Brings up an application CC BY 3.0 US, Harold A. Dost III 19
  • 20.
    Docker Compose Commands build- Build or rebuild services kill - Kill containers up - Create and start containers migrate-to-labels - Recreate containers to add labels version - Show the Docker-Compose version information CC BY 3.0 US, Harold A. Dost III 20
  • 21.
    The docker-compose.yml 1 web: build:. links: - db ports: - "8000:8000" db: image: postgres 1 For more information about file arguments check here. CC BY 3.0 US, Harold A. Dost III 21
  • 22.
    MAVEN Plugins » https://github.com/spotify/docker-maven-plugin »https://github.com/rhuss/docker-maven-plugin » https://github.com/wouterd/docker-maven-plugin CC BY 3.0 US, Harold A. Dost III 22
  • 23.
    Real world Demo CCBY 3.0 US, Harold A. Dost III 23
  • 24.
    Using Docker Machine CCBY 3.0 US, Harold A. Dost III 24
  • 25.
    Using Docker Engine CCBY 3.0 US, Harold A. Dost III 25
  • 26.
    Running Composed Docker Containers CCBY 3.0 US, Harold A. Dost III 26
  • 27.
    Perform Tests CC BY3.0 US, Harold A. Dost III 27
  • 28.
    Combining Docker with CI CCBY 3.0 US, Harold A. Dost III 28
  • 29.
    Questions? CC BY 3.0US, Harold A. Dost III 29