SlideShare una empresa de Scribd logo
1 de 30
Develop, Test & Deploy with Docker
Jonas Schwabe
me.json
Docker
• Containerization instead of virtualization
• Containers are lightweight
• Prebuilt images instead of VM installation
• “Works on my machine!” ⟷ “Works on your machine!”
The Problem
Dependency
• Modern software developers need to handle a lot of dependencies
• Operating environment
• Development tools
• Testing infrastructure
• Build & Deployment tools
• Different projects? Different versions!
• Manually: Tedious, time-consuming
Software parts
• There are multiple separate parts software is being composed of:
• ExtJS 6 Frontend
• Backend Service
• Database Server
• Key-Value Store
• …
• Install / upgrade complicated
• Docker: Get a readable & executable definition of how to install / update the stack
Environments
• The software needs to work on:
• Developer’s computers (Windows / MacOS / Linux)
• CI Server (Linux)
• Staging/Live System (Linux)
• What could possibly go wrong?
Docker - Theory
The Image
• Read-only “template” for a container
• Based on an image which might be based on an image which might be based on…
• Contains:
• OS
• Dependencies
• Software
• Atomic - One service per image
Dockerfile - Define an Image
• Base image
• Add your Software
• Dependencies
• Build
• Run
FROM node:latest
ADD src /opt/demo
WORKDIR /opt/demo
RUN npm install
CMD ["npm", "start"]
The Container
• Derives from an image
• Statefull
• Runs a command or service
• Can interact with other containers
• Acts a lot like a VM
The Host
• Docker runs with modern Linux kernel (> 3.10)
• Mac OS & Windows support is available through lightweight Virtual Machines
• Using Docker feels nearly the same across all systems
• Same CLI for every system
• Containers don’t care about the host
Infrastructure
DockerHub & Registry
• Images can be exported and shared
• Registries distribute images
• Docker Hub hosts loads of public images
• You can host your own registry
CI Workflow Example
• CI Server
• Pulls Dockerfile and source code from your VCS
• Pulls base image from Docker Hub
• Builds an image containing your Project
• Pushes the image to a private/public registry
• The destination server
• Deploys from the private/public registry
Source Code Base Image
Image
Build Dockerfile
Container ContainerContainer
Docker & Sencha
CMD
• Sencha CMD is being packed into the docker image
• Upgrade CMD version seamlessly, everyone is synced after a container pull
• You will never have to upgrade multiple CI nodes after a local CMD upgrade!
Dockerfile
• Image will contain a production app
which is being served by nginx
• For development you can run ‚sencha
app watch‘ instead of nginx
FROM nginx:latest
RUN apt-get update -y && apt-get install -y 
unzip 
openjdk-7-jre 
wget 
nginx
WORKDIR /tmp
RUN wget http://cdn.sencha.com/cmd/6.1.3/no-jre/SenchaCmd-6.1.3-linux-
amd64.sh.zip
RUN unzip SenchaCmd-6.1.3-linux-amd64.sh.zip
COPY conf/senchacmd.varfile /tmp/senchacmd.varfile
RUN /tmp/`find SenchaCmd*.sh` -q -varfile /tmp/senchacmd.varfile -dir "/opt/sencha"
RUN ln -s /opt/sencha/sencha /usr/local/bin/sencha
COPY src /opt/demo
WORKDIR /opt/demo
RUN sencha app build
RUN cp -r build/production/demo /usr/share/nginx/html
Frontend & Backend
• ExtJS developers should not have to worry about their backend
• Install & Upgrade should be as easy as running:
• docker-compose up
• docker-compose up --pull
• It actually is that easy:
docker-compose.yml
• Defines which containers should be
started and how they should interact
• Defines volumes to map a folder in
the container to a folder on the host
• Exposes ports through the Host
version: '2'
services:
db:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: your
MYSQL_USER: user
MYSQL_PASSWORD: and
MYSQL_DATABASE: password
back:
build: backend
ports:
- "3000:3000"
links:
- db
front:
build: frontend
ports:
- "1841:1841"
command: sencha app watch
volumes:
- "./frontend/src:/opt/demo"
docker-compose
• After running ‚docker-compose up‘ with the previous definition:
• A database is running
• The backend is running and connected to the database
• The fronted is running through sencha app watch
Example
# git clone git@github.com:jnugh/SenchConExample.git
# cd SenchaConExample
# docker-compose up
[Building front, Pulling DB]
Building back
Step 1 : FROM node:latest
latest: Pulling from library/node
8ad8b3f87b37: Pull complete
751fe39c4d34: Pull complete
ae3b77eefc06: Pull complete
7783aac582ec: Pull complete
393ad8a32e58: Pull complete
2d923dade19b: Pull complete
Digest:
sha256:9cd81e673bde91e503fd5022df5d5ff716b4e518718b2196947b6[…]
Status: Downloaded newer image for node:latest
---> e3e7156ded1f
Step 2 : ADD src /opt/demo
---> a29df260324a
Removing intermediate container 107c296da3f8
Step 3 : WORKDIR /opt/demo
---> Running in 007a0cbdc760
---> caf3f579d11d
Removing intermediate container 007a0cbdc760
Step 4 : RUN npm install
---> Running in 9fd93940d56f
npm info it worked if it ends with ok
npm info using npm@3.10.3
npm info using node@v6.5.0
npm info lifecycle demo@0.0.0~preinstall: demo@0.0.0
npm info linkStuff demo@0.0.0
npm info lifecycle demo@0.0.0~install: demo@0.0.0
npm info lifecycle demo@0.0.0~postinstall: demo@0.0.0
npm info lifecycle demo@0.0.0~prepublish: demo@0.0.0
npm info ok
---> 6a3b6d45e1b8
Removing intermediate container 9fd93940d56f
Step 5 : CMD npm start
---> Running in 9a4d0d11a19b
---> c0bbd78dd304
Removing intermediate container 9a4d0d11a19b
Successfully built c0bbd78dd304
Bootstrap a Dev Environment
Bootstrap a Dev Environment
• Frontend, Backend and DB are up and running as configured
• Focus on the code right away
# docker-compose logs back
Attaching to senchacon2016_back_1
back_1 | npm info it worked if it ends with ok
back_1 | npm info using npm@3.10.3
back_1 | npm info using node@v6.4.0
back_1 | npm info lifecycle demo@0.0.0~prestart: demo@0.0.0
back_1 | npm info lifecycle demo@0.0.0~start: demo@0.0.0
back_1 |
back_1 | > demo@0.0.0 start /opt/demo
back_1 | > node ./bin/www
back_1 |
back_1 | npm info lifecycle demo@0.0.0~poststart: demo@0.0.0
back_1 | npm info ok
back_1 | npm info it worked if it ends with ok
back_1 | npm info using npm@3.10.3
back_1 | npm info using node@v6.4.0
back_1 | npm info lifecycle demo@0.0.0~prestart: demo@0.0.0
back_1 | npm info lifecycle demo@0.0.0~start: demo@0.0.0
back_1 |
back_1 | > demo@0.0.0 start /opt/demo
back_1 | > node ./bin/www
back_1 |
back_1 | GET / 200 5945.959 ms - 170
back_1 | GET /stylesheets/style.css 200 46.090 ms - 111
back_1 | GET /favicon.ico 404 135.085 ms - 905
back_1 | npm info lifecycle demo@0.0.0~poststart: demo@0.0.0
back_1 | npm info ok
# docker-compose logs front
Attaching to senchacon2016_front_1
front_1 | Sencha Cmd v6.1.3.42
front_1 | [INF] Processing Build Descriptor : classic
front_1 | [INF] Starting server on port : 1841
[…]
front_1 | [INF] Writing content to /opt/demo/classic.json
front_1 | [INF] merging 223 input resources into
/opt/demo/build/development/demo/classic/resources
front_1 | [INF] merged 0 resources into
/opt/demo/build/development/demo/classic/resources
front_1 | [INF] merging 18 input resources into /opt/demo/build/development/demo
front_1 | [INF] merged 0 resources into /opt/demo/build/development/demo
front_1 | [INF] Writing content to /opt/demo/sass/example/bootstrap.json
front_1 | [INF] Writing content to /opt/demo/sass/example/bootstrap.js
front_1 | [INF] writing sass content to
/opt/demo/build/temp/development/demo/sass/demo-all.scss.tmp
front_1 | [INF] appending sass content to
/opt/demo/build/temp/development/demo/sass/demo-all.scss.tmp
front_1 | [INF] appending sass content to
/opt/demo/build/temp/development/demo/sass/demo-all.scss.tmp
front_1 | [LOG] Building /opt/demo/build/temp/development/demo/sass/demo-all.scss
front_1 | [INF] Appending content to /opt/demo/bootstrap.js
front_1 | [INF] Writing content to /opt/demo/classic.json
front_1 | [INF] Waiting for changes...
Logs
# docker-compose exec front bash
root@d63736c82620:/opt/demo# sencha generate view demo.view.main.TestView
Sencha Cmd v6.1.3.42
root@d63736c82620:/opt/demo# ls app/view/demo/view/main/TestView* -la
-rw-r--r-- 1 root root 349 Sep 15 10:28 app/view/demo/view/main/TestView.js
-rw-r--r-- 1 root root 155 Sep 15 10:28 app/view/demo/view/main/TestViewController.js
-rw-r--r-- 1 root root 180 Sep 15 10:28 app/view/demo/view/main/TestViewModel.js
Shell
Demo
• Pull this simple demo from: https://github.com/jnugh/SenchConExample
Questions?
Please Take the Survey in the Mobile App
• Navigate to this session in the mobile app
• Click on “Evaluate Session”
• Respondents will be entered into a A to win one of five $50 Amazon gift cards
SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe

Más contenido relacionado

La actualidad más candente

β 1. η ακμη της ευρωπαϊκης αποικιοκρατιας (1871 1914)
β 1. η ακμη της ευρωπαϊκης αποικιοκρατιας (1871 1914)β 1. η ακμη της ευρωπαϊκης αποικιοκρατιας (1871 1914)
β 1. η ακμη της ευρωπαϊκης αποικιοκρατιας (1871 1914)
Πηνελόπη Ρασιδάκη
 
Ο ελληνικός εμφύλιος πόλεμος
Ο ελληνικός εμφύλιος πόλεμοςΟ ελληνικός εμφύλιος πόλεμος
Ο ελληνικός εμφύλιος πόλεμος
dromeas
 
ΤΑ ΡΩΜΑΪΚΑ ΚΑΙ ΒΥΖΑΝΤΙΝΑ ΜΝΗΜΕΙΑ ΤΗΣ ΘΕΣΣΑΛΟΝΙΚΗΣ
ΤΑ ΡΩΜΑΪΚΑ ΚΑΙ ΒΥΖΑΝΤΙΝΑ ΜΝΗΜΕΙΑ ΤΗΣ ΘΕΣΣΑΛΟΝΙΚΗΣΤΑ ΡΩΜΑΪΚΑ ΚΑΙ ΒΥΖΑΝΤΙΝΑ ΜΝΗΜΕΙΑ ΤΗΣ ΘΕΣΣΑΛΟΝΙΚΗΣ
ΤΑ ΡΩΜΑΪΚΑ ΚΑΙ ΒΥΖΑΝΤΙΝΑ ΜΝΗΜΕΙΑ ΤΗΣ ΘΕΣΣΑΛΟΝΙΚΗΣ
xristoi
 
γραμμική άλγεβρα Emπ
γραμμική άλγεβρα   Emπγραμμική άλγεβρα   Emπ
γραμμική άλγεβρα Emπ
Vasilis Tsougkas
 

La actualidad más candente (20)

Περιγραφή κτίσματος - Σημειώσεις
Περιγραφή κτίσματος - ΣημειώσειςΠεριγραφή κτίσματος - Σημειώσεις
Περιγραφή κτίσματος - Σημειώσεις
 
Στο τσιμεντένιο δάσος (2014) Β΄1
Στο τσιμεντένιο δάσος (2014) Β΄1Στο τσιμεντένιο δάσος (2014) Β΄1
Στο τσιμεντένιο δάσος (2014) Β΄1
 
φύλλο εργασίας
φύλλο εργασίαςφύλλο εργασίας
φύλλο εργασίας
 
β 1. η ακμη της ευρωπαϊκης αποικιοκρατιας (1871 1914)
β 1. η ακμη της ευρωπαϊκης αποικιοκρατιας (1871 1914)β 1. η ακμη της ευρωπαϊκης αποικιοκρατιας (1871 1914)
β 1. η ακμη της ευρωπαϊκης αποικιοκρατιας (1871 1914)
 
SQL
SQLSQL
SQL
 
1. απο τη ρωμη στη νεα ρωμη
1. απο τη ρωμη στη νεα ρωμη1. απο τη ρωμη στη νεα ρωμη
1. απο τη ρωμη στη νεα ρωμη
 
Eisagogi eleni
Eisagogi eleniEisagogi eleni
Eisagogi eleni
 
H ζωή στη Σύμη
H ζωή στη ΣύμηH ζωή στη Σύμη
H ζωή στη Σύμη
 
Φύλλο εργασίας αρχαία α γυμν 9 ενότητα
Φύλλο εργασίας αρχαία α γυμν 9 ενότηταΦύλλο εργασίας αρχαία α γυμν 9 ενότητα
Φύλλο εργασίας αρχαία α γυμν 9 ενότητα
 
Ιστορία Γ΄λυκείου
Ιστορία Γ΄λυκείουΙστορία Γ΄λυκείου
Ιστορία Γ΄λυκείου
 
Νεοελληνική Γλώσσα Β Γυμνασίου Ενότητα 4 Φύλλο εργασίας
Νεοελληνική Γλώσσα Β Γυμνασίου Ενότητα 4 Φύλλο εργασίαςΝεοελληνική Γλώσσα Β Γυμνασίου Ενότητα 4 Φύλλο εργασίας
Νεοελληνική Γλώσσα Β Γυμνασίου Ενότητα 4 Φύλλο εργασίας
 
ΓΛΩΣΣΑ_Α_ΓΥΜΝΑΣΙΟΥ.pdf
ΓΛΩΣΣΑ_Α_ΓΥΜΝΑΣΙΟΥ.pdfΓΛΩΣΣΑ_Α_ΓΥΜΝΑΣΙΟΥ.pdf
ΓΛΩΣΣΑ_Α_ΓΥΜΝΑΣΙΟΥ.pdf
 
Ο ελληνικός εμφύλιος πόλεμος
Ο ελληνικός εμφύλιος πόλεμοςΟ ελληνικός εμφύλιος πόλεμος
Ο ελληνικός εμφύλιος πόλεμος
 
ελληνικη επανασταση και γυναικες
ελληνικη επανασταση και γυναικεςελληνικη επανασταση και γυναικες
ελληνικη επανασταση και γυναικες
 
εκπ
εκπεκπ
εκπ
 
Τα τραγουδια του Πόντου
Τα τραγουδια του ΠόντουΤα τραγουδια του Πόντου
Τα τραγουδια του Πόντου
 
ΤΑ ΡΩΜΑΪΚΑ ΚΑΙ ΒΥΖΑΝΤΙΝΑ ΜΝΗΜΕΙΑ ΤΗΣ ΘΕΣΣΑΛΟΝΙΚΗΣ
ΤΑ ΡΩΜΑΪΚΑ ΚΑΙ ΒΥΖΑΝΤΙΝΑ ΜΝΗΜΕΙΑ ΤΗΣ ΘΕΣΣΑΛΟΝΙΚΗΣΤΑ ΡΩΜΑΪΚΑ ΚΑΙ ΒΥΖΑΝΤΙΝΑ ΜΝΗΜΕΙΑ ΤΗΣ ΘΕΣΣΑΛΟΝΙΚΗΣ
ΤΑ ΡΩΜΑΪΚΑ ΚΑΙ ΒΥΖΑΝΤΙΝΑ ΜΝΗΜΕΙΑ ΤΗΣ ΘΕΣΣΑΛΟΝΙΚΗΣ
 
γραμμική άλγεβρα Emπ
γραμμική άλγεβρα   Emπγραμμική άλγεβρα   Emπ
γραμμική άλγεβρα Emπ
 
18. Από την άφιξη του Όθωνα (1833) ως την 3η Σεπτεμβρίου 1843
18. Από την άφιξη του Όθωνα (1833) ως την 3η Σεπτεμβρίου 184318. Από την άφιξη του Όθωνα (1833) ως την 3η Σεπτεμβρίου 1843
18. Από την άφιξη του Όθωνα (1833) ως την 3η Σεπτεμβρίου 1843
 
Ιστορία Στ' Τάξη Η Ελλάδα στα τέλη του 19ου αιώνα
Ιστορία Στ' Τάξη Η Ελλάδα στα τέλη του 19ου αιώναΙστορία Στ' Τάξη Η Ελλάδα στα τέλη του 19ου αιώνα
Ιστορία Στ' Τάξη Η Ελλάδα στα τέλη του 19ου αιώνα
 

Destacado

Destacado (20)

Docker
DockerDocker
Docker
 
Docker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12XDocker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12X
 
The age of orchestration: from Docker basics to cluster management
The age of orchestration: from Docker basics to cluster managementThe age of orchestration: from Docker basics to cluster management
The age of orchestration: from Docker basics to cluster management
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra  SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
 
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
 
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
SenchaCon 2016: Enterprise Applications, Role Based Access Controls (RBAC) an...
 
SenchaCon 2016: Building a Faceted Catalog of Video Game Assets Using Ext JS ...
SenchaCon 2016: Building a Faceted Catalog of Video Game Assets Using Ext JS ...SenchaCon 2016: Building a Faceted Catalog of Video Game Assets Using Ext JS ...
SenchaCon 2016: Building a Faceted Catalog of Video Game Assets Using Ext JS ...
 
SenchaCon 2016: A Data-Driven Application for the Embedded World - Jean-Phili...
SenchaCon 2016: A Data-Driven Application for the Embedded World - Jean-Phili...SenchaCon 2016: A Data-Driven Application for the Embedded World - Jean-Phili...
SenchaCon 2016: A Data-Driven Application for the Embedded World - Jean-Phili...
 
SenchaCon 2016: Upgrading an Ext JS 4.x Application to Ext JS 6.x - Mark Linc...
SenchaCon 2016: Upgrading an Ext JS 4.x Application to Ext JS 6.x - Mark Linc...SenchaCon 2016: Upgrading an Ext JS 4.x Application to Ext JS 6.x - Mark Linc...
SenchaCon 2016: Upgrading an Ext JS 4.x Application to Ext JS 6.x - Mark Linc...
 
SenchaCon 2016: Advanced Techniques for Buidling Ext JS Apps with Electron - ...
SenchaCon 2016: Advanced Techniques for Buidling Ext JS Apps with Electron - ...SenchaCon 2016: Advanced Techniques for Buidling Ext JS Apps with Electron - ...
SenchaCon 2016: Advanced Techniques for Buidling Ext JS Apps with Electron - ...
 
SenchaCon 2016: Theming the Modern Toolkit - Phil Guerrant
SenchaCon 2016: Theming the Modern Toolkit - Phil Guerrant   SenchaCon 2016: Theming the Modern Toolkit - Phil Guerrant
SenchaCon 2016: Theming the Modern Toolkit - Phil Guerrant
 
Building Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff StanoBuilding Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff Stano
 
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...
SenchaCon 2016: Accessibility, Teamwork & Ext JS: A Customer Success Story - ...
 
SenchaCon 2016: Integrating Geospatial Maps & Big Data Using CartoDB via Ext ...
SenchaCon 2016: Integrating Geospatial Maps & Big Data Using CartoDB via Ext ...SenchaCon 2016: Integrating Geospatial Maps & Big Data Using CartoDB via Ext ...
SenchaCon 2016: Integrating Geospatial Maps & Big Data Using CartoDB via Ext ...
 
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi   SenchaCon 2016: The Modern Toolchain - Ross Gerbasi
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi
 
SenchaCon 2016: Turbocharge your Ext JS App - Per Minborg, Anselm McClain, Jo...
SenchaCon 2016: Turbocharge your Ext JS App - Per Minborg, Anselm McClain, Jo...SenchaCon 2016: Turbocharge your Ext JS App - Per Minborg, Anselm McClain, Jo...
SenchaCon 2016: Turbocharge your Ext JS App - Per Minborg, Anselm McClain, Jo...
 
SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...
SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...
SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...
 
SenchaCon 2016: Modernizing the Ext JS Class System - Don Griffin
SenchaCon 2016: Modernizing the Ext JS Class System - Don GriffinSenchaCon 2016: Modernizing the Ext JS Class System - Don Griffin
SenchaCon 2016: Modernizing the Ext JS Class System - Don Griffin
 
SenchaCon 2016: Refine Enterprise Applications by Focusing on U0ser Experienc...
SenchaCon 2016: Refine Enterprise Applications by Focusing on U0ser Experienc...SenchaCon 2016: Refine Enterprise Applications by Focusing on U0ser Experienc...
SenchaCon 2016: Refine Enterprise Applications by Focusing on U0ser Experienc...
 

Similar a SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe

Was liberty profile and docker
Was liberty profile and dockerWas liberty profile and docker
Was liberty profile and docker
sflynn073
 

Similar a SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe (20)

Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous Integration
 
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
 
How to create your own hack environment
How to create your own hack environmentHow to create your own hack environment
How to create your own hack environment
 
[NYC Meetup] Docker at Nuxeo
[NYC Meetup] Docker at Nuxeo[NYC Meetup] Docker at Nuxeo
[NYC Meetup] Docker at Nuxeo
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java bin
 
Develop with docker 2014 aug
Develop with docker 2014 augDevelop with docker 2014 aug
Develop with docker 2014 aug
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
 
Detailed Introduction To Docker
Detailed Introduction To DockerDetailed Introduction To Docker
Detailed Introduction To Docker
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Deliver Python Apps with Docker
Deliver Python Apps with DockerDeliver Python Apps with Docker
Deliver Python Apps with Docker
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for Development
 
ContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small businessContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small business
 
Experts Live Europe 2017 - Why you should care about Docker - an introduction
Experts Live Europe 2017 - Why you should care about Docker - an introductionExperts Live Europe 2017 - Why you should care about Docker - an introduction
Experts Live Europe 2017 - Why you should care about Docker - an introduction
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
WebSphere Application Server Liberty Profile and Docker
WebSphere Application Server Liberty Profile and DockerWebSphere Application Server Liberty Profile and Docker
WebSphere Application Server Liberty Profile and Docker
 
Was liberty profile and docker
Was liberty profile and dockerWas liberty profile and docker
Was liberty profile and docker
 
Continuous Integration with Docker on AWS
Continuous Integration with Docker on AWSContinuous Integration with Docker on AWS
Continuous Integration with Docker on AWS
 
Intro docker and demo monitor on docker
Intro docker and demo monitor on dockerIntro docker and demo monitor on docker
Intro docker and demo monitor on docker
 

Más de Sencha

Más de Sencha (20)

Breathe New Life into Your Existing JavaScript Applications with Web Components
Breathe New Life into Your Existing JavaScript Applications with Web ComponentsBreathe New Life into Your Existing JavaScript Applications with Web Components
Breathe New Life into Your Existing JavaScript Applications with Web Components
 
Ext JS 6.6 Highlights
Ext JS 6.6 HighlightsExt JS 6.6 Highlights
Ext JS 6.6 Highlights
 
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
 
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
 
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App TestingSencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
 
Sencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha TestSencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha Test
 
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
 
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
 
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
 
Sencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop FirstSencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop First
 
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and BeyondSencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
 
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data GridLeveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
 
Learn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportLearn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research Report
 
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React AppsIntroducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
 
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark BrocatoSenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
 
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
 
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
 
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
 
Ext JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell SimeonsExt JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell Simeons
 
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
 

Último

Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
UK Journal
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Último (20)

TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 

SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe

  • 1. Develop, Test & Deploy with Docker Jonas Schwabe
  • 3. Docker • Containerization instead of virtualization • Containers are lightweight • Prebuilt images instead of VM installation • “Works on my machine!” ⟷ “Works on your machine!”
  • 5. Dependency • Modern software developers need to handle a lot of dependencies • Operating environment • Development tools • Testing infrastructure • Build & Deployment tools • Different projects? Different versions! • Manually: Tedious, time-consuming
  • 6. Software parts • There are multiple separate parts software is being composed of: • ExtJS 6 Frontend • Backend Service • Database Server • Key-Value Store • … • Install / upgrade complicated • Docker: Get a readable & executable definition of how to install / update the stack
  • 7. Environments • The software needs to work on: • Developer’s computers (Windows / MacOS / Linux) • CI Server (Linux) • Staging/Live System (Linux) • What could possibly go wrong?
  • 9. The Image • Read-only “template” for a container • Based on an image which might be based on an image which might be based on… • Contains: • OS • Dependencies • Software • Atomic - One service per image
  • 10. Dockerfile - Define an Image • Base image • Add your Software • Dependencies • Build • Run FROM node:latest ADD src /opt/demo WORKDIR /opt/demo RUN npm install CMD ["npm", "start"]
  • 11. The Container • Derives from an image • Statefull • Runs a command or service • Can interact with other containers • Acts a lot like a VM
  • 12. The Host • Docker runs with modern Linux kernel (> 3.10) • Mac OS & Windows support is available through lightweight Virtual Machines • Using Docker feels nearly the same across all systems • Same CLI for every system • Containers don’t care about the host
  • 14. DockerHub & Registry • Images can be exported and shared • Registries distribute images • Docker Hub hosts loads of public images • You can host your own registry
  • 15. CI Workflow Example • CI Server • Pulls Dockerfile and source code from your VCS • Pulls base image from Docker Hub • Builds an image containing your Project • Pushes the image to a private/public registry • The destination server • Deploys from the private/public registry Source Code Base Image Image Build Dockerfile Container ContainerContainer
  • 17. CMD • Sencha CMD is being packed into the docker image • Upgrade CMD version seamlessly, everyone is synced after a container pull • You will never have to upgrade multiple CI nodes after a local CMD upgrade!
  • 18. Dockerfile • Image will contain a production app which is being served by nginx • For development you can run ‚sencha app watch‘ instead of nginx FROM nginx:latest RUN apt-get update -y && apt-get install -y unzip openjdk-7-jre wget nginx WORKDIR /tmp RUN wget http://cdn.sencha.com/cmd/6.1.3/no-jre/SenchaCmd-6.1.3-linux- amd64.sh.zip RUN unzip SenchaCmd-6.1.3-linux-amd64.sh.zip COPY conf/senchacmd.varfile /tmp/senchacmd.varfile RUN /tmp/`find SenchaCmd*.sh` -q -varfile /tmp/senchacmd.varfile -dir "/opt/sencha" RUN ln -s /opt/sencha/sencha /usr/local/bin/sencha COPY src /opt/demo WORKDIR /opt/demo RUN sencha app build RUN cp -r build/production/demo /usr/share/nginx/html
  • 19. Frontend & Backend • ExtJS developers should not have to worry about their backend • Install & Upgrade should be as easy as running: • docker-compose up • docker-compose up --pull • It actually is that easy:
  • 20. docker-compose.yml • Defines which containers should be started and how they should interact • Defines volumes to map a folder in the container to a folder on the host • Exposes ports through the Host version: '2' services: db: image: mariadb environment: MYSQL_ROOT_PASSWORD: your MYSQL_USER: user MYSQL_PASSWORD: and MYSQL_DATABASE: password back: build: backend ports: - "3000:3000" links: - db front: build: frontend ports: - "1841:1841" command: sencha app watch volumes: - "./frontend/src:/opt/demo"
  • 21. docker-compose • After running ‚docker-compose up‘ with the previous definition: • A database is running • The backend is running and connected to the database • The fronted is running through sencha app watch
  • 23. # git clone git@github.com:jnugh/SenchConExample.git # cd SenchaConExample # docker-compose up [Building front, Pulling DB] Building back Step 1 : FROM node:latest latest: Pulling from library/node 8ad8b3f87b37: Pull complete 751fe39c4d34: Pull complete ae3b77eefc06: Pull complete 7783aac582ec: Pull complete 393ad8a32e58: Pull complete 2d923dade19b: Pull complete Digest: sha256:9cd81e673bde91e503fd5022df5d5ff716b4e518718b2196947b6[…] Status: Downloaded newer image for node:latest ---> e3e7156ded1f Step 2 : ADD src /opt/demo ---> a29df260324a Removing intermediate container 107c296da3f8 Step 3 : WORKDIR /opt/demo ---> Running in 007a0cbdc760 ---> caf3f579d11d Removing intermediate container 007a0cbdc760 Step 4 : RUN npm install ---> Running in 9fd93940d56f npm info it worked if it ends with ok npm info using npm@3.10.3 npm info using node@v6.5.0 npm info lifecycle demo@0.0.0~preinstall: demo@0.0.0 npm info linkStuff demo@0.0.0 npm info lifecycle demo@0.0.0~install: demo@0.0.0 npm info lifecycle demo@0.0.0~postinstall: demo@0.0.0 npm info lifecycle demo@0.0.0~prepublish: demo@0.0.0 npm info ok ---> 6a3b6d45e1b8 Removing intermediate container 9fd93940d56f Step 5 : CMD npm start ---> Running in 9a4d0d11a19b ---> c0bbd78dd304 Removing intermediate container 9a4d0d11a19b Successfully built c0bbd78dd304 Bootstrap a Dev Environment
  • 24. Bootstrap a Dev Environment • Frontend, Backend and DB are up and running as configured • Focus on the code right away
  • 25. # docker-compose logs back Attaching to senchacon2016_back_1 back_1 | npm info it worked if it ends with ok back_1 | npm info using npm@3.10.3 back_1 | npm info using node@v6.4.0 back_1 | npm info lifecycle demo@0.0.0~prestart: demo@0.0.0 back_1 | npm info lifecycle demo@0.0.0~start: demo@0.0.0 back_1 | back_1 | > demo@0.0.0 start /opt/demo back_1 | > node ./bin/www back_1 | back_1 | npm info lifecycle demo@0.0.0~poststart: demo@0.0.0 back_1 | npm info ok back_1 | npm info it worked if it ends with ok back_1 | npm info using npm@3.10.3 back_1 | npm info using node@v6.4.0 back_1 | npm info lifecycle demo@0.0.0~prestart: demo@0.0.0 back_1 | npm info lifecycle demo@0.0.0~start: demo@0.0.0 back_1 | back_1 | > demo@0.0.0 start /opt/demo back_1 | > node ./bin/www back_1 | back_1 | GET / 200 5945.959 ms - 170 back_1 | GET /stylesheets/style.css 200 46.090 ms - 111 back_1 | GET /favicon.ico 404 135.085 ms - 905 back_1 | npm info lifecycle demo@0.0.0~poststart: demo@0.0.0 back_1 | npm info ok # docker-compose logs front Attaching to senchacon2016_front_1 front_1 | Sencha Cmd v6.1.3.42 front_1 | [INF] Processing Build Descriptor : classic front_1 | [INF] Starting server on port : 1841 […] front_1 | [INF] Writing content to /opt/demo/classic.json front_1 | [INF] merging 223 input resources into /opt/demo/build/development/demo/classic/resources front_1 | [INF] merged 0 resources into /opt/demo/build/development/demo/classic/resources front_1 | [INF] merging 18 input resources into /opt/demo/build/development/demo front_1 | [INF] merged 0 resources into /opt/demo/build/development/demo front_1 | [INF] Writing content to /opt/demo/sass/example/bootstrap.json front_1 | [INF] Writing content to /opt/demo/sass/example/bootstrap.js front_1 | [INF] writing sass content to /opt/demo/build/temp/development/demo/sass/demo-all.scss.tmp front_1 | [INF] appending sass content to /opt/demo/build/temp/development/demo/sass/demo-all.scss.tmp front_1 | [INF] appending sass content to /opt/demo/build/temp/development/demo/sass/demo-all.scss.tmp front_1 | [LOG] Building /opt/demo/build/temp/development/demo/sass/demo-all.scss front_1 | [INF] Appending content to /opt/demo/bootstrap.js front_1 | [INF] Writing content to /opt/demo/classic.json front_1 | [INF] Waiting for changes... Logs
  • 26. # docker-compose exec front bash root@d63736c82620:/opt/demo# sencha generate view demo.view.main.TestView Sencha Cmd v6.1.3.42 root@d63736c82620:/opt/demo# ls app/view/demo/view/main/TestView* -la -rw-r--r-- 1 root root 349 Sep 15 10:28 app/view/demo/view/main/TestView.js -rw-r--r-- 1 root root 155 Sep 15 10:28 app/view/demo/view/main/TestViewController.js -rw-r--r-- 1 root root 180 Sep 15 10:28 app/view/demo/view/main/TestViewModel.js Shell
  • 27. Demo • Pull this simple demo from: https://github.com/jnugh/SenchConExample
  • 29. Please Take the Survey in the Mobile App • Navigate to this session in the mobile app • Click on “Evaluate Session” • Respondents will be entered into a A to win one of five $50 Amazon gift cards