building reusable development environments with docker
TRANSCRIPT
![Page 1: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/1.jpg)
Building Reusable Development Environments with Docker
Harold DostRaastech, Inc.
CC BY 3.0 US, Harold A. Dost III 1
![Page 2: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/2.jpg)
About Me
Harold Dost (@hdost)7+ years of Oracle Middleware experienceOCE (SOA Foundation Practitioner)Oracle ACE AssociateFrom Michiganblog.raastech.com
CC BY 3.0 US, Harold A. Dost III 2
![Page 3: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/3.jpg)
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
![Page 4: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/4.jpg)
Docker
CC BY 3.0 US, Harold A. Dost III 4
![Page 5: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/5.jpg)
The Docker Ecosystem
CC BY 3.0 US, Harold A. Dost III 5
![Page 6: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/6.jpg)
Tools
» Docker Machine
» Docker Engine
» Docker Compose
» Docker Registry
CC BY 3.0 US, Harold A. Dost III 6
![Page 7: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/7.jpg)
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-VCC BY 3.0 US, Harold A. Dost III 7
![Page 8: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/8.jpg)
Docker Machine cont.» Other VM Targets
» OpenStack
» Oracle VirtualBox
» VMware Fusion®
» vCloud® Air™
» vSphere®
CC BY 3.0 US, Harold A. Dost III 8
![Page 9: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/9.jpg)
Docker MachineCreates a dummy machine
docker-machine create --driver virtualbox default
CC BY 3.0 US, Harold A. Dost III 9
![Page 10: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/10.jpg)
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
![Page 11: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/11.jpg)
Using Docker Engine» 39 Different commands
» Only covering some of the most used
CC BY 3.0 US, Harold A. Dost III 11
![Page 12: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/12.jpg)
Commands: Retrievepull - Pull an image or a repository from a registry
CC BY 3.0 US, Harold A. Dost III 12
![Page 13: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/13.jpg)
Commands: Create and Deletecreate - Create a new containerrm - Remove one or more containersrmi - Remove one or more images
CC BY 3.0 US, Harold A. Dost III 13
![Page 14: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/14.jpg)
Commands: Start and Stopstart - Start 1+ stopped containersstop - Stop a running containerexec - Run command in running containerrun - Run command in new containerkill - Kill a running containerrestart - Restart a running container
CC BY 3.0 US, Harold A. Dost III 14
![Page 15: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/15.jpg)
Commands: Organizerename - Rename a containertag - Tag an image into a repositorycommit - Create a new image from a container's changes
CC BY 3.0 US, Harold A. Dost III 15
![Page 16: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/16.jpg)
Commands: Etc.cp - Copy files to and from containersport - List port mappingsps - List containersattach - Attach to a running container
CC BY 3.0 US, Harold A. Dost III 16
![Page 17: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/17.jpg)
Dockerfile 1
FROM java:8RUN apt-get updateRUN apt-get install -y maven nodejsEXPOSE 9000WORKDIR /appCOPY app /appRUN chown -R appuser /appUSER appuserENTRYPOINT mvn spring-boot:run
1 For more information about file arguments check here.
CC BY 3.0 US, Harold A. Dost III 17
![Page 18: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/18.jpg)
Docker Compose» Create Multi-container Applications
» Example:
» Java App
» Database
CC BY 3.0 US, Harold A. Dost III 18
![Page 19: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/19.jpg)
Docker Compose» Uses decriptor file compose.yml
» Brings up an application
CC BY 3.0 US, Harold A. Dost III 19
![Page 20: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/20.jpg)
Docker Compose Commandsbuild - Build or rebuild serviceskill - Kill containersup - Create and start containersmigrate-to-labels - Recreate containers to add labelsversion - Show the Docker-Compose version information
CC BY 3.0 US, Harold A. Dost III 20
![Page 21: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/21.jpg)
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
![Page 22: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/22.jpg)
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
![Page 23: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/23.jpg)
Real world Demo
CC BY 3.0 US, Harold A. Dost III 23
![Page 24: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/24.jpg)
Using Docker Machine
CC BY 3.0 US, Harold A. Dost III 24
![Page 25: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/25.jpg)
Using Docker Engine
CC BY 3.0 US, Harold A. Dost III 25
![Page 26: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/26.jpg)
Running Composed Docker Containers
CC BY 3.0 US, Harold A. Dost III 26
![Page 27: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/27.jpg)
Perform Tests
CC BY 3.0 US, Harold A. Dost III 27
![Page 28: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/28.jpg)
Combining Docker with CI
CC BY 3.0 US, Harold A. Dost III 28
![Page 29: Building Reusable Development Environments with Docker](https://reader031.vdocuments.site/reader031/viewer/2022030317/586e8bf01a28aba0038b8269/html5/thumbnails/29.jpg)
Questions?
CC BY 3.0 US, Harold A. Dost III 29