SlideShare a Scribd company logo
Development Workflow Guide
for Building Docker Apps
By Abdul khan
Author
• Abdul Khan
• IT Consultant based in Manchester, UK
• Engineering Lead, Executive, Technologist, Architect
• IT experience, within the private and public sectors (Retail, Banking, Digital, Insurance, M.O.D., HMRC, Aviation, Telecommunication,
Housing Associations, Education, Travel, and Pharmaceutical companies). Excellent architectural and strong DevOps experience with
proven-track record of delivering E2E, B2B and B2C solution on regional and global programs.
• SME in specializing in providing integration, data migration, digital transformations to the cloud solutions (Azure and AWS)
• Wealth of experience in global projects across EMEA, ASPAC and LATAM
• Liked in profile https://www.linkedin.com/in/abdul-khan-uk/
Accreditations
Thank you to my good friend and colleague for reviewing, adding value, sharing their vast experience and
knowledge.
• Steve Lampton (IT Consultant, Cloud SME) specialising in NetOps, DevOps and SecOps
Audience
Main Audience
• Architects
• Technical Leads and DevOps, NetOps an d SecOps
Assumptions
• Reader has some knowledge of Docker containerisation, and cloud platforms
technologies.
Development Workflow Guide for
Building Docker Apps
Content
1. Introduction
2. Step-by-step Workflow For Developing Docker Containerized Apps
3. Walk-Through – Initial Dockerfile (1/2) – Coding Sample
4. Walk-Though – Initial Dockerfile (2/2) – Coding Sample Explained
5. Walk-Though –Docker Compose File– Coding Sample
1. Introduction
• The application development life cycle (ADLC) starts on the development box, The
application code is unit tested locally. With this workflow, no matter which
language, framework, and platform you choose, you're always developing and
testing Docker containers, but doing so locally.
• Each container (an instance of a Docker image) includes the following
components:
• An operating system selection, for example, a Linux distribution, Windows Nano Server, or
Windows Server Core.
• Files added during development, for example, source code and application binaries.
• Configuration information, such as environment settings and dependencies.
2. Step-by-step Workflow For Developing
Docker Containerized Apps
1
Code/ Your app
Docker Repos
6
Test Your App
or Microservice
App
CImages
Remote Docker
Registry
App
CBase
Images
7
(CI/CD) Push or
Continue Developing
2
Write
Dockerfiles(s)
3
Create Images
defined at
Dockerfile(S)
4
Define Services by
writing Docker-
compose yml
5
Run Containers
/ Compose App
My Images My
Container
Git push to
source control
Walk Through - Initial Dockerfile (1/2)
1 FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 AS base
2 WORKDIR /app
3 EXPOSE 80
4
5 FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build
6 WORKDIR /src
7 COPY src/Services/Catalog/Catalog.API/Catalog.API.csproj …
8 COPY src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks …
9 COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks …
10 COPY src/BuildingBlocks/EventBus/IntegrationEventLogEF/ …
11 COPY src/BuildingBlocks/EventBus/EventBus/EventBus.csproj …
12 COPY src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj …
13 COPY src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj …
14 COPY src/BuildingBlocks/WebHostCustomization/WebHost.Customization …
15 COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions …
16 COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions …
17 RUN dotnet restore src/Services/Catalog/Catalog.API/Catalog.API.csproj
18 COPY . .
19 WORKDIR /src/src/Services/Catalog/Catalog.API
20 RUN dotnet build Catalog.API.csproj -c Release -o /app
21
22 FROM build AS publish
23 RUN dotnet publish Catalog.API.csproj -c Release -o /app
24
25 FROM base AS final
26 WORKDIR /app
27 COPY --from=publish /app .
28 ENTRYPOINT ["dotnet", "Catalog.API.dll"]
Walk-Through – Initial Dockerfile (2/2)
The details, line by lines are:
Line #1: Begin a stage with a "small" runtime-only base image, call it base for reference.
Line #2: Create the /app directory in the image.
Line #3: Expose port 80.
Line #5: Begin a new stage with the "large" image for building/publishing. Call it build for reference.
Line #6: Create directory /src in the image.
Line #7: Up to line 16, copy referenced .csproj project files to be able to restore packages later.
Line #17: Restore packages for the Catalog.API project and the referenced projects.
Line #18: Copy all directory tree for the solution (except the files/directories included in the .dockerignore file) to the /src directory in
the image.
Line #19: Change the current folder to the Catalog.API project.
Line #20: Build the project (and other project dependencies) and output to the /app directory in the image.
Line #22: Begin a new stage continuing from the build. Call it publish for reference.
Line #23: Publish the project (and dependencies) and output to the /app directory in the image.
Line #25: Begin a new stage continuing from base and call it final.
Line #26: Change the current directory to /app.
Line #27: Copy the /app directory from stage publish to the current directory.
Line #28: Define the command to run when the container is started.
Walk Through - Docker Compose YML
version: '3.4'
services:
webmvc:
image: eshop/web
environment:
- CatalogUrl=http://catalog.api
- OrderingUrl=http://ordering.api
ports:
- "80:80"
depends_on:
- catalog.api
- ordering.api
catalog.api:
image: eshop/catalog.api
environment:
- ConnectionString=Server=sql.data;Port=1433;Database=CatalogDB;…
ports:
- "81:80"
depends_on:
- sql.data
ordering.api:
image: eshop/ordering.api
environment:
- ConnectionString=Server=sql.data;Database=OrderingDb;…
ports:
- "82:80"
extra_hosts:
- "CESARDLBOOKVHD:10.0.75.1"
depends_on:
- sql.data
sql.data:
image: mssql-server-linux:latest
environment:
- SA_PASSWORD=Pass@word
- ACCEPT_EULA=Y
ports:
- "5433:1433"
- END OF DECK
By Abdul Khan – https://www.linkedin.com/in/abdul-khan-uk/

More Related Content

What's hot

Using Docker EE in a CI/CD Workflow
Using Docker EE in a CI/CD WorkflowUsing Docker EE in a CI/CD Workflow
Using Docker EE in a CI/CD Workflow
Ashnikbiz
 
.Net Online TechTalk “Your application is going to stay more serverless by us...
.Net Online TechTalk “Your application is going to stay more serverless by us....Net Online TechTalk “Your application is going to stay more serverless by us...
.Net Online TechTalk “Your application is going to stay more serverless by us...
GlobalLogic Ukraine
 
.docker : how to deploy Digital Experience in a container drinking a cup of c...
.docker : how to deploy Digital Experience in a container drinking a cup of c....docker : how to deploy Digital Experience in a container drinking a cup of c...
.docker : how to deploy Digital Experience in a container drinking a cup of c...
Andrea Fontana
 
Cicd pixelfederation
Cicd pixelfederationCicd pixelfederation
Cicd pixelfederation
Juraj Hantak
 
Who needs containers in a serverless world
Who needs containers in a serverless worldWho needs containers in a serverless world
Who needs containers in a serverless world
Matthias Luebken
 
Version your build process as you version your code
Version your build process as you version your codeVersion your build process as you version your code
Version your build process as you version your code
Vincent Latombe
 
PaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer Demand
PaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer DemandPaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer Demand
PaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer Demand
Cisco IT
 
Docker Birthday #3 Slides - Overview
Docker Birthday #3 Slides - OverviewDocker Birthday #3 Slides - Overview
Docker Birthday #3 Slides - OverviewChris Ciborowski
 
Kubernetes Helm: Why It Matters
Kubernetes Helm: Why It MattersKubernetes Helm: Why It Matters
Kubernetes Helm: Why It Matters
Platform9
 
How to use source control with apex?
How to use source control with apex?How to use source control with apex?
How to use source control with apex?
Oliver Lemm
 
Resume-Kalyan
Resume-KalyanResume-Kalyan
Resume-KalyanKalyan V
 
“Full-stack developer: з чого розпочати кар’єру?”
 “Full-stack developer: з чого розпочати кар’єру?”  “Full-stack developer: з чого розпочати кар’єру?”
“Full-stack developer: з чого розпочати кар’єру?”
GlobalLogic Ukraine
 
July OpenNTF Webinar - HCL Presents Keep, a new API for Domino
July OpenNTF Webinar - HCL Presents Keep, a new API for DominoJuly OpenNTF Webinar - HCL Presents Keep, a new API for Domino
July OpenNTF Webinar - HCL Presents Keep, a new API for Domino
Howard Greenberg
 
Helm at reddit: from local dev, staging, to production
Helm at reddit: from local dev, staging, to productionHelm at reddit: from local dev, staging, to production
Helm at reddit: from local dev, staging, to production
Gregory Taylor
 
Building Microservices with the 12 Factor App Pattern on AWS.pdf
Building Microservices with the 12 Factor App Pattern on AWS.pdfBuilding Microservices with the 12 Factor App Pattern on AWS.pdf
Building Microservices with the 12 Factor App Pattern on AWS.pdf
Amazon Web Services
 
CI/CD Development in Kubernetes - Skaffold
CI/CD Development in Kubernetes -  SkaffoldCI/CD Development in Kubernetes -  Skaffold
CI/CD Development in Kubernetes - Skaffold
Suman Chakraborty
 
Introduction To Flink
Introduction To FlinkIntroduction To Flink
Introduction To Flink
Knoldus Inc.
 
Managing Open Source software in the Docker era
Managing Open Source software in the Docker era Managing Open Source software in the Docker era
Managing Open Source software in the Docker era
nexB Inc.
 

What's hot (20)

Using Docker EE in a CI/CD Workflow
Using Docker EE in a CI/CD WorkflowUsing Docker EE in a CI/CD Workflow
Using Docker EE in a CI/CD Workflow
 
.Net Online TechTalk “Your application is going to stay more serverless by us...
.Net Online TechTalk “Your application is going to stay more serverless by us....Net Online TechTalk “Your application is going to stay more serverless by us...
.Net Online TechTalk “Your application is going to stay more serverless by us...
 
.docker : how to deploy Digital Experience in a container drinking a cup of c...
.docker : how to deploy Digital Experience in a container drinking a cup of c....docker : how to deploy Digital Experience in a container drinking a cup of c...
.docker : how to deploy Digital Experience in a container drinking a cup of c...
 
desktop_resume
desktop_resumedesktop_resume
desktop_resume
 
Cicd pixelfederation
Cicd pixelfederationCicd pixelfederation
Cicd pixelfederation
 
Who needs containers in a serverless world
Who needs containers in a serverless worldWho needs containers in a serverless world
Who needs containers in a serverless world
 
Version your build process as you version your code
Version your build process as you version your codeVersion your build process as you version your code
Version your build process as you version your code
 
PaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer Demand
PaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer DemandPaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer Demand
PaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer Demand
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Docker Birthday #3 Slides - Overview
Docker Birthday #3 Slides - OverviewDocker Birthday #3 Slides - Overview
Docker Birthday #3 Slides - Overview
 
Kubernetes Helm: Why It Matters
Kubernetes Helm: Why It MattersKubernetes Helm: Why It Matters
Kubernetes Helm: Why It Matters
 
How to use source control with apex?
How to use source control with apex?How to use source control with apex?
How to use source control with apex?
 
Resume-Kalyan
Resume-KalyanResume-Kalyan
Resume-Kalyan
 
“Full-stack developer: з чого розпочати кар’єру?”
 “Full-stack developer: з чого розпочати кар’єру?”  “Full-stack developer: з чого розпочати кар’єру?”
“Full-stack developer: з чого розпочати кар’єру?”
 
July OpenNTF Webinar - HCL Presents Keep, a new API for Domino
July OpenNTF Webinar - HCL Presents Keep, a new API for DominoJuly OpenNTF Webinar - HCL Presents Keep, a new API for Domino
July OpenNTF Webinar - HCL Presents Keep, a new API for Domino
 
Helm at reddit: from local dev, staging, to production
Helm at reddit: from local dev, staging, to productionHelm at reddit: from local dev, staging, to production
Helm at reddit: from local dev, staging, to production
 
Building Microservices with the 12 Factor App Pattern on AWS.pdf
Building Microservices with the 12 Factor App Pattern on AWS.pdfBuilding Microservices with the 12 Factor App Pattern on AWS.pdf
Building Microservices with the 12 Factor App Pattern on AWS.pdf
 
CI/CD Development in Kubernetes - Skaffold
CI/CD Development in Kubernetes -  SkaffoldCI/CD Development in Kubernetes -  Skaffold
CI/CD Development in Kubernetes - Skaffold
 
Introduction To Flink
Introduction To FlinkIntroduction To Flink
Introduction To Flink
 
Managing Open Source software in the Docker era
Managing Open Source software in the Docker era Managing Open Source software in the Docker era
Managing Open Source software in the Docker era
 

Similar to Development workflow guide for building docker apps

Docker Bday #5, SF Edition: Introduction to Docker
Docker Bday #5, SF Edition: Introduction to DockerDocker Bday #5, SF Edition: Introduction to Docker
Docker Bday #5, SF Edition: Introduction to Docker
Docker, Inc.
 
Tampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday DockerTampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday Docker
Sakari Hoisko
 
Docker Birthday #5 Meetup Cluj - Presentation
Docker Birthday #5 Meetup Cluj - PresentationDocker Birthday #5 Meetup Cluj - Presentation
Docker Birthday #5 Meetup Cluj - Presentation
Alex Vranceanu
 
Docker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker SlidesDocker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker Slides
Docker, Inc.
 
Containers and Microservices for Realists
Containers and Microservices for RealistsContainers and Microservices for Realists
Containers and Microservices for Realists
Oracle Developers
 
Containers and microservices for realists
Containers and microservices for realistsContainers and microservices for realists
Containers and microservices for realists
Karthik Gaekwad
 
Docker Application to Scientific Computing
Docker Application to Scientific ComputingDocker Application to Scientific Computing
Docker Application to Scientific Computing
Peter Bryzgalov
 
Categorizing Docker Hub Public Images
Categorizing Docker Hub Public ImagesCategorizing Docker Hub Public Images
Categorizing Docker Hub Public Images
Roberto Hashioka
 
docker : how to deploy Digital Experience in a container drinking a cup of co...
docker : how to deploy Digital Experience in a container drinking a cup of co...docker : how to deploy Digital Experience in a container drinking a cup of co...
docker : how to deploy Digital Experience in a container drinking a cup of co...
Matteo Bisi
 
Docker Enterprise Edition Overview by Steven Thwaites, Technical Solutions En...
Docker Enterprise Edition Overview by Steven Thwaites, Technical Solutions En...Docker Enterprise Edition Overview by Steven Thwaites, Technical Solutions En...
Docker Enterprise Edition Overview by Steven Thwaites, Technical Solutions En...
Ashnikbiz
 
HPC Cloud Burst Using Docker
HPC Cloud Burst Using DockerHPC Cloud Burst Using Docker
HPC Cloud Burst Using Docker
IRJET Journal
 
Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14
Simon Storm
 
Week 8 lecture material
Week 8 lecture materialWeek 8 lecture material
Week 8 lecture material
Ankit Gupta
 
[20200720]cloud native develoment - Nelson Lin
[20200720]cloud native develoment - Nelson Lin[20200720]cloud native develoment - Nelson Lin
[20200720]cloud native develoment - Nelson Lin
HanLing Shen
 
.docker : How to deploy Digital Experience in a container, drinking a cup of ...
.docker : How to deploy Digital Experience in a container, drinking a cup of ....docker : How to deploy Digital Experience in a container, drinking a cup of ...
.docker : How to deploy Digital Experience in a container, drinking a cup of ...
ICON UK EVENTS Limited
 
Bahrain ch9 introduction to docker 5th birthday
Bahrain ch9 introduction to docker 5th birthday Bahrain ch9 introduction to docker 5th birthday
Bahrain ch9 introduction to docker 5th birthday
Walid Shaari
 
Docker EE 2.0 choice security agility by Erik Tan,Tech Insights Singapore - 2...
Docker EE 2.0 choice security agility by Erik Tan,Tech Insights Singapore - 2...Docker EE 2.0 choice security agility by Erik Tan,Tech Insights Singapore - 2...
Docker EE 2.0 choice security agility by Erik Tan,Tech Insights Singapore - 2...
Ashnikbiz
 
Docker EE 2.0 Choice, Security & Agility
Docker EE 2.0Choice, Security & AgilityDocker EE 2.0Choice, Security & Agility
Docker EE 2.0 Choice, Security & Agility
Ashnikbiz
 
Dockers and kubernetes
Dockers and kubernetesDockers and kubernetes
Dockers and kubernetes
Dr Ganesh Iyer
 
The world of Docker and Kubernetes
The world of Docker and Kubernetes The world of Docker and Kubernetes
The world of Docker and Kubernetes
vty
 

Similar to Development workflow guide for building docker apps (20)

Docker Bday #5, SF Edition: Introduction to Docker
Docker Bday #5, SF Edition: Introduction to DockerDocker Bday #5, SF Edition: Introduction to Docker
Docker Bday #5, SF Edition: Introduction to Docker
 
Tampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday DockerTampere Docker meetup - Happy 5th Birthday Docker
Tampere Docker meetup - Happy 5th Birthday Docker
 
Docker Birthday #5 Meetup Cluj - Presentation
Docker Birthday #5 Meetup Cluj - PresentationDocker Birthday #5 Meetup Cluj - Presentation
Docker Birthday #5 Meetup Cluj - Presentation
 
Docker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker SlidesDocker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker Slides
 
Containers and Microservices for Realists
Containers and Microservices for RealistsContainers and Microservices for Realists
Containers and Microservices for Realists
 
Containers and microservices for realists
Containers and microservices for realistsContainers and microservices for realists
Containers and microservices for realists
 
Docker Application to Scientific Computing
Docker Application to Scientific ComputingDocker Application to Scientific Computing
Docker Application to Scientific Computing
 
Categorizing Docker Hub Public Images
Categorizing Docker Hub Public ImagesCategorizing Docker Hub Public Images
Categorizing Docker Hub Public Images
 
docker : how to deploy Digital Experience in a container drinking a cup of co...
docker : how to deploy Digital Experience in a container drinking a cup of co...docker : how to deploy Digital Experience in a container drinking a cup of co...
docker : how to deploy Digital Experience in a container drinking a cup of co...
 
Docker Enterprise Edition Overview by Steven Thwaites, Technical Solutions En...
Docker Enterprise Edition Overview by Steven Thwaites, Technical Solutions En...Docker Enterprise Edition Overview by Steven Thwaites, Technical Solutions En...
Docker Enterprise Edition Overview by Steven Thwaites, Technical Solutions En...
 
HPC Cloud Burst Using Docker
HPC Cloud Burst Using DockerHPC Cloud Burst Using Docker
HPC Cloud Burst Using Docker
 
Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14Docker dev ops for cd meetup 12-14
Docker dev ops for cd meetup 12-14
 
Week 8 lecture material
Week 8 lecture materialWeek 8 lecture material
Week 8 lecture material
 
[20200720]cloud native develoment - Nelson Lin
[20200720]cloud native develoment - Nelson Lin[20200720]cloud native develoment - Nelson Lin
[20200720]cloud native develoment - Nelson Lin
 
.docker : How to deploy Digital Experience in a container, drinking a cup of ...
.docker : How to deploy Digital Experience in a container, drinking a cup of ....docker : How to deploy Digital Experience in a container, drinking a cup of ...
.docker : How to deploy Digital Experience in a container, drinking a cup of ...
 
Bahrain ch9 introduction to docker 5th birthday
Bahrain ch9 introduction to docker 5th birthday Bahrain ch9 introduction to docker 5th birthday
Bahrain ch9 introduction to docker 5th birthday
 
Docker EE 2.0 choice security agility by Erik Tan,Tech Insights Singapore - 2...
Docker EE 2.0 choice security agility by Erik Tan,Tech Insights Singapore - 2...Docker EE 2.0 choice security agility by Erik Tan,Tech Insights Singapore - 2...
Docker EE 2.0 choice security agility by Erik Tan,Tech Insights Singapore - 2...
 
Docker EE 2.0 Choice, Security & Agility
Docker EE 2.0Choice, Security & AgilityDocker EE 2.0Choice, Security & Agility
Docker EE 2.0 Choice, Security & Agility
 
Dockers and kubernetes
Dockers and kubernetesDockers and kubernetes
Dockers and kubernetes
 
The world of Docker and Kubernetes
The world of Docker and Kubernetes The world of Docker and Kubernetes
The world of Docker and Kubernetes
 

More from Abdul Khan

7 Ways To Cyberattack And Hack Azure
7 Ways To Cyberattack And Hack Azure7 Ways To Cyberattack And Hack Azure
7 Ways To Cyberattack And Hack Azure
Abdul Khan
 
Guide to security patterns for cloud systems and data security in aws and azure
Guide to security patterns for cloud systems and data security in aws and azureGuide to security patterns for cloud systems and data security in aws and azure
Guide to security patterns for cloud systems and data security in aws and azure
Abdul Khan
 
Cloud security comparisons between aws and azure
Cloud security comparisons between aws and azureCloud security comparisons between aws and azure
Cloud security comparisons between aws and azure
Abdul Khan
 
Complete Architecture and Development Guide To Windows Communication Foundati...
Complete Architecture and Development Guide To Windows Communication Foundati...Complete Architecture and Development Guide To Windows Communication Foundati...
Complete Architecture and Development Guide To Windows Communication Foundati...
Abdul Khan
 
Development workflow guide for building docker apps
Development workflow guide for building docker appsDevelopment workflow guide for building docker apps
Development workflow guide for building docker apps
Abdul Khan
 
Understanding docker ecosystem and vulnerabilities points
Understanding docker ecosystem and vulnerabilities pointsUnderstanding docker ecosystem and vulnerabilities points
Understanding docker ecosystem and vulnerabilities points
Abdul Khan
 
How To Manage And Reduce Development Techical Debt
How To Manage And Reduce Development Techical DebtHow To Manage And Reduce Development Techical Debt
How To Manage And Reduce Development Techical Debt
Abdul Khan
 

More from Abdul Khan (7)

7 Ways To Cyberattack And Hack Azure
7 Ways To Cyberattack And Hack Azure7 Ways To Cyberattack And Hack Azure
7 Ways To Cyberattack And Hack Azure
 
Guide to security patterns for cloud systems and data security in aws and azure
Guide to security patterns for cloud systems and data security in aws and azureGuide to security patterns for cloud systems and data security in aws and azure
Guide to security patterns for cloud systems and data security in aws and azure
 
Cloud security comparisons between aws and azure
Cloud security comparisons between aws and azureCloud security comparisons between aws and azure
Cloud security comparisons between aws and azure
 
Complete Architecture and Development Guide To Windows Communication Foundati...
Complete Architecture and Development Guide To Windows Communication Foundati...Complete Architecture and Development Guide To Windows Communication Foundati...
Complete Architecture and Development Guide To Windows Communication Foundati...
 
Development workflow guide for building docker apps
Development workflow guide for building docker appsDevelopment workflow guide for building docker apps
Development workflow guide for building docker apps
 
Understanding docker ecosystem and vulnerabilities points
Understanding docker ecosystem and vulnerabilities pointsUnderstanding docker ecosystem and vulnerabilities points
Understanding docker ecosystem and vulnerabilities points
 
How To Manage And Reduce Development Techical Debt
How To Manage And Reduce Development Techical DebtHow To Manage And Reduce Development Techical Debt
How To Manage And Reduce Development Techical Debt
 

Recently uploaded

To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 

Recently uploaded (20)

To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 

Development workflow guide for building docker apps

  • 1. Development Workflow Guide for Building Docker Apps By Abdul khan
  • 2. Author • Abdul Khan • IT Consultant based in Manchester, UK • Engineering Lead, Executive, Technologist, Architect • IT experience, within the private and public sectors (Retail, Banking, Digital, Insurance, M.O.D., HMRC, Aviation, Telecommunication, Housing Associations, Education, Travel, and Pharmaceutical companies). Excellent architectural and strong DevOps experience with proven-track record of delivering E2E, B2B and B2C solution on regional and global programs. • SME in specializing in providing integration, data migration, digital transformations to the cloud solutions (Azure and AWS) • Wealth of experience in global projects across EMEA, ASPAC and LATAM • Liked in profile https://www.linkedin.com/in/abdul-khan-uk/
  • 3. Accreditations Thank you to my good friend and colleague for reviewing, adding value, sharing their vast experience and knowledge. • Steve Lampton (IT Consultant, Cloud SME) specialising in NetOps, DevOps and SecOps
  • 4. Audience Main Audience • Architects • Technical Leads and DevOps, NetOps an d SecOps Assumptions • Reader has some knowledge of Docker containerisation, and cloud platforms technologies.
  • 5. Development Workflow Guide for Building Docker Apps
  • 6. Content 1. Introduction 2. Step-by-step Workflow For Developing Docker Containerized Apps 3. Walk-Through – Initial Dockerfile (1/2) – Coding Sample 4. Walk-Though – Initial Dockerfile (2/2) – Coding Sample Explained 5. Walk-Though –Docker Compose File– Coding Sample
  • 7. 1. Introduction • The application development life cycle (ADLC) starts on the development box, The application code is unit tested locally. With this workflow, no matter which language, framework, and platform you choose, you're always developing and testing Docker containers, but doing so locally. • Each container (an instance of a Docker image) includes the following components: • An operating system selection, for example, a Linux distribution, Windows Nano Server, or Windows Server Core. • Files added during development, for example, source code and application binaries. • Configuration information, such as environment settings and dependencies.
  • 8. 2. Step-by-step Workflow For Developing Docker Containerized Apps 1 Code/ Your app Docker Repos 6 Test Your App or Microservice App CImages Remote Docker Registry App CBase Images 7 (CI/CD) Push or Continue Developing 2 Write Dockerfiles(s) 3 Create Images defined at Dockerfile(S) 4 Define Services by writing Docker- compose yml 5 Run Containers / Compose App My Images My Container Git push to source control
  • 9. Walk Through - Initial Dockerfile (1/2) 1 FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 AS base 2 WORKDIR /app 3 EXPOSE 80 4 5 FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build 6 WORKDIR /src 7 COPY src/Services/Catalog/Catalog.API/Catalog.API.csproj … 8 COPY src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks … 9 COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks … 10 COPY src/BuildingBlocks/EventBus/IntegrationEventLogEF/ … 11 COPY src/BuildingBlocks/EventBus/EventBus/EventBus.csproj … 12 COPY src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj … 13 COPY src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj … 14 COPY src/BuildingBlocks/WebHostCustomization/WebHost.Customization … 15 COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions … 16 COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions … 17 RUN dotnet restore src/Services/Catalog/Catalog.API/Catalog.API.csproj 18 COPY . . 19 WORKDIR /src/src/Services/Catalog/Catalog.API 20 RUN dotnet build Catalog.API.csproj -c Release -o /app 21 22 FROM build AS publish 23 RUN dotnet publish Catalog.API.csproj -c Release -o /app 24 25 FROM base AS final 26 WORKDIR /app 27 COPY --from=publish /app . 28 ENTRYPOINT ["dotnet", "Catalog.API.dll"]
  • 10. Walk-Through – Initial Dockerfile (2/2) The details, line by lines are: Line #1: Begin a stage with a "small" runtime-only base image, call it base for reference. Line #2: Create the /app directory in the image. Line #3: Expose port 80. Line #5: Begin a new stage with the "large" image for building/publishing. Call it build for reference. Line #6: Create directory /src in the image. Line #7: Up to line 16, copy referenced .csproj project files to be able to restore packages later. Line #17: Restore packages for the Catalog.API project and the referenced projects. Line #18: Copy all directory tree for the solution (except the files/directories included in the .dockerignore file) to the /src directory in the image. Line #19: Change the current folder to the Catalog.API project. Line #20: Build the project (and other project dependencies) and output to the /app directory in the image. Line #22: Begin a new stage continuing from the build. Call it publish for reference. Line #23: Publish the project (and dependencies) and output to the /app directory in the image. Line #25: Begin a new stage continuing from base and call it final. Line #26: Change the current directory to /app. Line #27: Copy the /app directory from stage publish to the current directory. Line #28: Define the command to run when the container is started.
  • 11. Walk Through - Docker Compose YML version: '3.4' services: webmvc: image: eshop/web environment: - CatalogUrl=http://catalog.api - OrderingUrl=http://ordering.api ports: - "80:80" depends_on: - catalog.api - ordering.api catalog.api: image: eshop/catalog.api environment: - ConnectionString=Server=sql.data;Port=1433;Database=CatalogDB;… ports: - "81:80" depends_on: - sql.data ordering.api: image: eshop/ordering.api environment: - ConnectionString=Server=sql.data;Database=OrderingDb;… ports: - "82:80" extra_hosts: - "CESARDLBOOKVHD:10.0.75.1" depends_on: - sql.data sql.data: image: mssql-server-linux:latest environment: - SA_PASSWORD=Pass@word - ACCEPT_EULA=Y ports: - "5433:1433"
  • 12. - END OF DECK By Abdul Khan – https://www.linkedin.com/in/abdul-khan-uk/