SlideShare uma empresa Scribd logo
1 de 91
Running Docker in Development
& Production
@Ben_Hall
Ben@BenHall.me.uk
Blog.BenHall.me.uk
Who?
@Ben_Hall
Tech Support > Tester > Developer > Founder / Freelancer
Agenda
• Introduction to Docker & Containers
• One Container
• Two Containers
• Three Containers
• Scale
Aim
Demonstrate steps required to create
- A Multi-Container
- Load Balanced
- ASP.NET / Nancy / Node.js Website
- Running Inside Containers via Docker
With The Lessons I Learned Along The Way
WHAT IS DOCKER?
Virtual Machine
https://www.docker.com/whatisdocker/
https://www.docker.com/whatisdocker/
Container
Own Process Space
Own Network Interface
Own Root Directories
Sandboxed
Like a lightweight VM. But it’s not a VM.
Container
Native CPU
Native Memory
Native IO
No Pre-Allocation
No Performance Overheard
Container
Docker - An open platform for distributed
applications for developers and sysadmins.
Otherwise known as tooling / ecosystem to run
containers
Registry
Installing on OSX / Windows
https://github.com/boot2docker/
Installing In Production
'curl -sSL https://get.docker.com/ | sh'
https://github.com/docker/machine
ONE CONTAINER
$ docker run
--name === Friendly name
--rm === Remove when finished
-t === Attach to terminal
-i === Interactive
Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
> docker run -d #Run In Background
elasticsearch #Image Name
https://www.dropbox.com/s/fbe8briq6ayycrh/start-elastic.gif?dl=0
Dockerfile
Dockerfile &
App Source
Build
Image
https://docs.docker.com/reference/builder/
FROM
FROM benhall/aspnet-vnext-npm # Base Image
https://registry.hub.docker.com/u/benhall/aspnet-vnext-npm/
FROM microsoft/aspnet:1.0.0-beta4
RUN useradd -ms /bin/bash dev
RUN gpg --keyserver pool.sks-keyservers.net --recv-keys 7937DFD2AB06298B2293C3187D33FF9D0246406D
114F43EE0176B71C7BC219DD50A3051F888C628D
ENV NODE_VERSION 0.10.38
ENV NPM_VERSION 2.9.1
ENV APT_PACKAGES git
RUN apt-get update -qq && 
apt-get -yqq install $APT_PACKAGES && 
apt-get -yqq clean
RUN curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" 
&& curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" 
&& gpg --verify SHASUMS256.txt.asc 
&& grep " node-v$NODE_VERSION-linux-x64.tar.gz$" SHASUMS256.txt.asc | sha256sum -c - 
&& tar -xzf "node-v$NODE_VERSION-linux-x64.tar.gz" -C /usr/local --strip-components=1 
&& rm "node-v$NODE_VERSION-linux-x64.tar.gz" SHASUMS256.txt.asc 
&& npm install -g npm@"$NPM_VERSION" 
&& npm cache clear
apt-get -y install autoconf automake build-essential libtool
run curl -SLO http://libuv.org/dist/v1.0.0/libuv-v1.0.0.tar.gz && 
tar xvf libuv-v1.0.0.tar.gz && 
rm libuv-v1.0.0.tar.gz && 
cd libuv-v1.0.0 && 
sh ./autogen.sh && 
./configure&& 
make && 
make install && 
cd .. && 
rm -rf libuv-v1.0.0 && 
ldconfig
RUN npm install -g bower grunt-cli
USER dev
WORKDIR /home/dev
Dockerfile – ADD / WORKDIR /
RUN
COPY WebApplication /app
WORKDIR /app
RUN ["dnu", "restore”]
Dockerfile – EXPOSE / CMD
EXPOSE 5000
CMD ["dnx", ".", "kestrel"]
Example – ASP.NET vNext
FROM benhall/aspnet-vnext-npm
COPY WebApplication /app
WORKDIR /app
RUN ["dnu", "restore”]
EXPOSE 5000
CMD ["dnx", ".", "kestrel"]
Example - NancyFX
FROM benhall/docker-mono
COPY . /src
WORKDIR /src
RUN xbuild Nancy.Demo.Hosting.Docker.sln
EXPOSE 8080
CMD ["mono",
"src/bin/Nancy.Demo.Hosting.Docker.exe"]
Example – Node.JS
FROM node:0.10.38
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN npm install
COPY . /usr/src/app
EXPOSE 3001
CMD [ "npm", "start" ]
$ docker build
--t === Friendly name.
<Docker Hub Username>/<ProjectName>:<tag>
$ docker images
> cat .dockerignore #Ignore file in root
all_the_passwords.txt
.git/
node_modules/
bower_components/
$ docker run
$ docker ps
-a === Show all containers
> docker inspect elasticsearch
"NetworkSettings": {
"Bridge": "docker0",
"Gateway": "172.17.42.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"LinkLocalIPv6Address": "fe80::42:acff:fe11:3",
"LinkLocalIPv6PrefixLen": 64,
"MacAddress": "02:42:ac:11:00:03",
"PortMapping": null
}
$ docker run –p $CONTAINERPORT
> iptables -t nat -L –n
Chain DOCKER (1 references)
target prot opt source destination
DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:49163 to:172.17.0.27:80
DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:49164 to:172.17.0.29:3000
DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:49165 to:172.17.0.30:80
DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:49166 to:172.17.0.31:3000
DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:49167 to:172.17.0.38:80
DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:49168 to:172.17.0.40:3000
DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 to:172.17.0.95:80
> docker run -d #Run In Background
-p 9200:9200 -p 9300:9300 #Bind Ports
elasticsearch #Image Name
https://www.dropbox.com/s/fbe8briq6ayycrh/start-elastic.gif?dl=0
> curl b2d:9200 # b2d is my Boot2Docker VM
https://www.dropbox.com/s/fbe8briq6ayycrh/start-elastic.gif?dl=0
Recap
• docker registry
• docker run elasticsearch
• Create Dockerfile
• docker build –t image-name .
• docker run image-name
Go Lang
> cat Dockerfile
FROM golang:onbuild
> cat Makefile
NAME = ocelotuproar/docker-outdated
build:
docker build -t $(NAME) .
run:
docker run --rm --name $(INSTANCE) $(NAME)
> make build # Run Golang Compiler & Build
container
> make run # Run built application
Private NPM Repository
https://github.com/BenHall/docker-local-npm-
registry
> docker run -d -v $(pwd)/config.yaml:/opt/sinopia/config.yaml
-p 4873:4873
keyvanfatehi/sinopia:latest
> npm set registry http://b2d:4873
> npm adduser --registry http://b2d:4873
RStudio
• docker run -d -p 8787:8787 rocker/rstudio
TWO CONTAINERS /
PRODUCTION
Docker Push / Pull
> docker run -p 5000:5000 registry:2.0
> docker push myreg:5000/benhall/aspnet:20150617140759
> docker pull myreg:5000/benhall/aspnet:20150617140759
Persisting Data$ docker run –v <host-dir>:<container-dir>
image
-v /opt/docker/elasticsearch:/data
-v /opt/docker/mysql:/var/lib/mysql
-v
/docker/scrapbook/uploads:/app/public/uploads
-v $(PWD):/host
-v /var/log/syslog:/var/log/syslog
> docker run -d
--restart=always # Restart if exits non-zero
redis
Environment Variables
> docker run -d -p 9200:9200 -p 9300:9300
--name es # 1) Friendly Name
elasticsearch
> docker run –it –p 3000
--link es:elasticsearch #2) <container>:<alias>
your-application
> cat /etc/hosts
172.17.0.79 elasticsearch
> env
HOSTNAME=2f3b959b13a0
ELASTICSEARCH_PORT=tcp://172.17.0.79:9200
ELASTICSEARCH_PORT_9200_TCP=tcp://172.17.0.79:9200
ELASTICSEARCH_PORT_9200_TCP_ADDR=172.17.0.79
ELASTICSEARCH_PORT_9200_TCP_PORT=9200
ELASTICSEARCH_PORT_9200_TCP_PROTO=tcp
ELASTICSEARCH_NAME=/scrapbookv2_web_1/es
NODE_ENV=production
Two Websites On Port 80?
Nginx
Problematic Approach
> docker run -d --name nginx_root
--link blog_benhall-1:blog_benhall-1
--link scrapbook-1:scrapbook-1
--link scrapbook_web_1:scrapbook_web_1
--link brownbag_web_1:brownbag_web_1
-p 80:80
-v /opt/docker/nginx/www:/data
-v /opt/docker/nginx/sites:/etc/nginx/sites-enab
-v /opt/docker/nginx/logs:/var/log/nginx
dockerfile/nginx
Nginx Proxy
https://github.com/jwilder/nginx-proxy
https://www.dropbox.com/s/2f6y2frfjafc409/nginx-proxy-optimised.gif?dl=0
• -v /var/run/docker.sock:/tmp/docker.sock
• VIRTUAL_HOST=my.container.com
# HTTP 1.1 support
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
upstream my.container.com {
# agitated_hopper
server 172.17.0.35:5001;
}
server {
listen 80;
server_name my.container.com;
location / {
proxy_pass http://my.container.com;
}
}
> docker run -d --name blog_benhall_varnish
--link blog_benhall:wordpress
-e VIRTUAL_HOST=blog.benhall.me.uk
-e VARNISH_BACKEND_PORT=80
-e VARNISH_BACKEND_HOST=wordpress
benhall/docker-varnish
Nginx Varnish
blog_benhall_varnish
Wordpress
blog_benhall
THREE CONTAINERS
> cat docker-compose.yml
web: # Container Name
build: . # Build
links: # Links
- elasticsearch
ports: # Ports
- 3000
environment: # Environment
VIRTUAL_HOST: 'app.joinscrapbook.com'
NODE_ENV: 'production’
elasticsearch: # 2nd Container Name
image: elasticsearch:1.5 # Use Image
ports: # Ports
- 9200:9200
> docker-compose up # Start containers
–d # In background
Recreating scrapbookv2_nginx_1...
Recreating scrapbookv2_redis_1...
Recreating scrapbookv2_db_1...
Recreating scrapbookv2_elasticsearch_1...
Recreating scrapbookv2_web_1…
> docker-compose stop # Stop containers
Stopping scrapbookv2_web_1...
Stopping scrapbookv2_elasticsearch_1...
Stopping scrapbookv2_db_1...
Stopping scrapbookv2_redis_1...
Stopping scrapbookv2_nginx_1...
Schema Management Containers
> docker run –d # No need to bind ports
--name es # Friendly Name
dockerfile/elasticsearch
> docker run –rm
--link es:es # Link
Container:alias
myapp/schema:latest # Schema Image
Sidekick Container For Testing
> docker run –d # No need to bind ports
--name es # Friendly Name
dockerfile/elasticsearch
> docker run –it
--link es:es # Link
Container:alias
benhall/curl # Curl Image
curl http://es:9200 # Ping service
> echo $? # Exit Code
0 # Success
FOUR AND MORE! SCALE!
[tag.]<service>.service[.datacenter][.domain]
$ ping redis.service.east-aws.consul
$ ping redis.service.consul
A Load Balanced
ASP.NET/NancyFX/Node.js
Website running inside Docker
https://www.dropbox.com/s/gbcifo094c9v8ar/nancy-lb-demo-optimised.gif?dl=0
1) Docker raises events when containers start /
stop
2) Registrator listens to events adds the new
container’s details into Consul
3) Consul links container’s IP / Ports to DNS
names & discovery API
> ping redis.service.consul
4) Nginx uses Consul discovery API to write &
load config
Swarm
A Docker-native clustering system
http://12factor.net/
THE FUTURE?
Docker and Microsoft Partnership
SQL Server as a Container?
Spoon.NET
Visual Studio as a Container?
Docker as a Platform
http://www.joinscrapbook.com
IN SUMMARY…
Only tool I use for deployment
• Close gap between development and production
• Everything is a container!
• Docker Machine, Compose & Swarm
• Running platforms like Logstash, ElasticSearch,
Redis, EventStore, RavenDB, NancyFX etc?
Consider containers for deployment.
@Ben_Hall
Ben@BenHall.me.uk
Blog.BenHall.me.uk
Thank you
http://www.JoinScrapbook.com
2 Day Training in Oslo with ProgramUtvikling
September 2015

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Real World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS ApplicationReal World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS Application
 
Deploying applications to Windows Server 2016 and Windows Containers
Deploying applications to Windows Server 2016 and Windows ContainersDeploying applications to Windows Server 2016 and Windows Containers
Deploying applications to Windows Server 2016 and Windows Containers
 
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
 
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on DockerRunning High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
 
Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
 
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz LachJDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
 
DCSF19 Tips and Tricks of the Docker Captains
DCSF19 Tips and Tricks of the Docker Captains  DCSF19 Tips and Tricks of the Docker Captains
DCSF19 Tips and Tricks of the Docker Captains
 
Docker remote-api
Docker remote-apiDocker remote-api
Docker remote-api
 
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and ChefScaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
 
PHP development with Docker
PHP development with DockerPHP development with Docker
PHP development with Docker
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
Docker Runtime Security
Docker Runtime SecurityDocker Runtime Security
Docker Runtime Security
 
Getting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyGetting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and Symfony
 
Docker orchestration v4
Docker orchestration v4Docker orchestration v4
Docker orchestration v4
 
Docker command
Docker commandDocker command
Docker command
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
 
Docker security
Docker securityDocker security
Docker security
 
Docker practice
Docker practiceDocker practice
Docker practice
 

Destaque

Developing multi tenant applications for the cloud 3rd edition
Developing multi tenant applications for the cloud 3rd editionDeveloping multi tenant applications for the cloud 3rd edition
Developing multi tenant applications for the cloud 3rd edition
Steve Xu
 
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
MongoDB
 
Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...
Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...
Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...
Felix Gessert
 

Destaque (20)

Tips on solving E_TOO_MANY_THINGS_TO_LEARN with Kubernetes
Tips on solving E_TOO_MANY_THINGS_TO_LEARN with KubernetesTips on solving E_TOO_MANY_THINGS_TO_LEARN with Kubernetes
Tips on solving E_TOO_MANY_THINGS_TO_LEARN with Kubernetes
 
What Developers Need To Know About Visual Design
What Developers Need To Know About Visual DesignWhat Developers Need To Know About Visual Design
What Developers Need To Know About Visual Design
 
Embracing Startup Life and learning to think The Startup Way
Embracing Startup Life and learning to think The Startup WayEmbracing Startup Life and learning to think The Startup Way
Embracing Startup Life and learning to think The Startup Way
 
Learning to think "The Designer Way"
Learning to think "The Designer Way"Learning to think "The Designer Way"
Learning to think "The Designer Way"
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based Deployments
 
Developing multi tenant applications for the cloud 3rd edition
Developing multi tenant applications for the cloud 3rd editionDeveloping multi tenant applications for the cloud 3rd edition
Developing multi tenant applications for the cloud 3rd edition
 
Deploying web apis on core clr to docker
Deploying web apis on core clr to dockerDeploying web apis on core clr to docker
Deploying web apis on core clr to docker
 
The Velvet Revolution: Modernizing Traditional ASP.NET Apps with Docker
The Velvet Revolution: Modernizing Traditional ASP.NET Apps with DockerThe Velvet Revolution: Modernizing Traditional ASP.NET Apps with Docker
The Velvet Revolution: Modernizing Traditional ASP.NET Apps with Docker
 
Building Multi-tenant, Configurable, High Quality Applications on .NET for an...
Building Multi-tenant, Configurable, High Quality Applications on .NET for an...Building Multi-tenant, Configurable, High Quality Applications on .NET for an...
Building Multi-tenant, Configurable, High Quality Applications on .NET for an...
 
ASP.NET Core and Docker
ASP.NET Core and DockerASP.NET Core and Docker
ASP.NET Core and Docker
 
Cloud architecture from the field v1 (in touch)
Cloud architecture from the field v1 (in touch)Cloud architecture from the field v1 (in touch)
Cloud architecture from the field v1 (in touch)
 
Unicom DevCon - CI/CD for Asp.net core apps using Docker
Unicom DevCon - CI/CD for Asp.net core apps using DockerUnicom DevCon - CI/CD for Asp.net core apps using Docker
Unicom DevCon - CI/CD for Asp.net core apps using Docker
 
Docker All The Things - ASP.NET 4.x and Windows Server Containers
Docker All The Things - ASP.NET 4.x and Windows Server ContainersDocker All The Things - ASP.NET 4.x and Windows Server Containers
Docker All The Things - ASP.NET 4.x and Windows Server Containers
 
Navigating the turbulence on takeoff: Setting up SharePoint on Azure IaaS the...
Navigating the turbulence on takeoff: Setting up SharePoint on Azure IaaS the...Navigating the turbulence on takeoff: Setting up SharePoint on Azure IaaS the...
Navigating the turbulence on takeoff: Setting up SharePoint on Azure IaaS the...
 
DeployR使ってみた話
DeployR使ってみた話DeployR使ってみた話
DeployR使ってみた話
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of users
 
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
 
(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy
(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy
(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy
 
Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...
Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...
Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...
 
Developing apps in Windows Containers using Docker
Developing apps in Windows Containers using DockerDeveloping apps in Windows Containers using Docker
Developing apps in Windows Containers using Docker
 

Semelhante a Running Docker in Development & Production (#ndcoslo 2015)

Chris Swan ONUG Academy - Container Networks Tutorial
Chris Swan ONUG Academy - Container Networks TutorialChris Swan ONUG Academy - Container Networks Tutorial
Chris Swan ONUG Academy - Container Networks Tutorial
Cohesive Networks
 

Semelhante a Running Docker in Development & Production (#ndcoslo 2015) (20)

Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
 
Wordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccionWordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccion
 
Start tracking your ruby infrastructure
Start tracking your ruby infrastructureStart tracking your ruby infrastructure
Start tracking your ruby infrastructure
 
Docker, the Future of DevOps
Docker, the Future of DevOpsDocker, the Future of DevOps
Docker, the Future of DevOps
 
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
 
桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作
 
Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014
 
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windows
 
Docker, Kubernetes, and Google Cloud
Docker, Kubernetes, and Google CloudDocker, Kubernetes, and Google Cloud
Docker, Kubernetes, and Google Cloud
 
How Reconnix Is Using Docker
How Reconnix Is Using DockerHow Reconnix Is Using Docker
How Reconnix Is Using Docker
 
Docker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak PeekDocker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak Peek
 
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
 
Ruby on Rails and Docker - Why should I care?
Ruby on Rails and Docker - Why should I care?Ruby on Rails and Docker - Why should I care?
Ruby on Rails and Docker - Why should I care?
 
Simple docker hosting in FIWARE Lab
Simple docker hosting in FIWARE LabSimple docker hosting in FIWARE Lab
Simple docker hosting in FIWARE Lab
 
Chris Swan ONUG Academy - Container Networks Tutorial
Chris Swan ONUG Academy - Container Networks TutorialChris Swan ONUG Academy - Container Networks Tutorial
Chris Swan ONUG Academy - Container Networks Tutorial
 
Docker for Ruby Developers
Docker for Ruby DevelopersDocker for Ruby Developers
Docker for Ruby Developers
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
 
Infrastructure = code - 1 year later
Infrastructure = code - 1 year laterInfrastructure = code - 1 year later
Infrastructure = code - 1 year later
 
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署
 
Docker container management
Docker container managementDocker container management
Docker container management
 

Mais de Ben Hall

Mais de Ben Hall (17)

The Art Of Documentation - NDC Porto 2022
The Art Of Documentation - NDC Porto 2022The Art Of Documentation - NDC Porto 2022
The Art Of Documentation - NDC Porto 2022
 
The Art Of Documentation for Open Source Projects
The Art Of Documentation for Open Source ProjectsThe Art Of Documentation for Open Source Projects
The Art Of Documentation for Open Source Projects
 
Three Years of Lessons Running Potentially Malicious Code Inside Containers
Three Years of Lessons Running Potentially Malicious Code Inside ContainersThree Years of Lessons Running Potentially Malicious Code Inside Containers
Three Years of Lessons Running Potentially Malicious Code Inside Containers
 
Containers without docker
Containers without dockerContainers without docker
Containers without docker
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetes
 
The Art of Documentation and Readme.md for Open Source Projects
The Art of Documentation and Readme.md for Open Source ProjectsThe Art of Documentation and Readme.md for Open Source Projects
The Art of Documentation and Readme.md for Open Source Projects
 
How Secure Are Docker Containers?
How Secure Are Docker Containers?How Secure Are Docker Containers?
How Secure Are Docker Containers?
 
The Challenges of Becoming Cloud Native
The Challenges of Becoming Cloud NativeThe Challenges of Becoming Cloud Native
The Challenges of Becoming Cloud Native
 
Scaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceScaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container Service
 
The art of documentation and readme.md
The art of documentation and readme.mdThe art of documentation and readme.md
The art of documentation and readme.md
 
Experimenting and Learning Kubernetes and Tensorflow
Experimenting and Learning Kubernetes and TensorflowExperimenting and Learning Kubernetes and Tensorflow
Experimenting and Learning Kubernetes and Tensorflow
 
Learning Patterns for the Overworked Developer
Learning Patterns for the Overworked DeveloperLearning Patterns for the Overworked Developer
Learning Patterns for the Overworked Developer
 
Implementing Google's Material Design Guidelines
Implementing Google's Material Design GuidelinesImplementing Google's Material Design Guidelines
Implementing Google's Material Design Guidelines
 
The Art Of Building Prototypes and MVPs
The Art Of Building Prototypes and MVPsThe Art Of Building Prototypes and MVPs
The Art Of Building Prototypes and MVPs
 
Node.js Anti Patterns
Node.js Anti PatternsNode.js Anti Patterns
Node.js Anti Patterns
 
What Designs Need To Know About Visual Design
What Designs Need To Know About Visual DesignWhat Designs Need To Know About Visual Design
What Designs Need To Know About Visual Design
 
Real World Lessons On The Anti-Patterns of Node.JS
Real World Lessons On The Anti-Patterns of Node.JSReal World Lessons On The Anti-Patterns of Node.JS
Real World Lessons On The Anti-Patterns of Node.JS
 

Último

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Último (20)

%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
 
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - Kanchana
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 

Running Docker in Development & Production (#ndcoslo 2015)

  • 1. Running Docker in Development & Production @Ben_Hall Ben@BenHall.me.uk Blog.BenHall.me.uk
  • 2. Who? @Ben_Hall Tech Support > Tester > Developer > Founder / Freelancer
  • 3. Agenda • Introduction to Docker & Containers • One Container • Two Containers • Three Containers • Scale
  • 4. Aim Demonstrate steps required to create - A Multi-Container - Load Balanced - ASP.NET / Nancy / Node.js Website - Running Inside Containers via Docker With The Lessons I Learned Along The Way
  • 8. Own Process Space Own Network Interface Own Root Directories Sandboxed Like a lightweight VM. But it’s not a VM. Container
  • 9. Native CPU Native Memory Native IO No Pre-Allocation No Performance Overheard Container
  • 10.
  • 11.
  • 12.
  • 13. Docker - An open platform for distributed applications for developers and sysadmins. Otherwise known as tooling / ecosystem to run containers
  • 15.
  • 16. Installing on OSX / Windows https://github.com/boot2docker/
  • 17. Installing In Production 'curl -sSL https://get.docker.com/ | sh'
  • 20. $ docker run --name === Friendly name --rm === Remove when finished -t === Attach to terminal -i === Interactive Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
  • 21.
  • 22. > docker run -d #Run In Background elasticsearch #Image Name https://www.dropbox.com/s/fbe8briq6ayycrh/start-elastic.gif?dl=0
  • 24.
  • 27. FROM microsoft/aspnet:1.0.0-beta4 RUN useradd -ms /bin/bash dev RUN gpg --keyserver pool.sks-keyservers.net --recv-keys 7937DFD2AB06298B2293C3187D33FF9D0246406D 114F43EE0176B71C7BC219DD50A3051F888C628D ENV NODE_VERSION 0.10.38 ENV NPM_VERSION 2.9.1 ENV APT_PACKAGES git RUN apt-get update -qq && apt-get -yqq install $APT_PACKAGES && apt-get -yqq clean RUN curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" && curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" && gpg --verify SHASUMS256.txt.asc && grep " node-v$NODE_VERSION-linux-x64.tar.gz$" SHASUMS256.txt.asc | sha256sum -c - && tar -xzf "node-v$NODE_VERSION-linux-x64.tar.gz" -C /usr/local --strip-components=1 && rm "node-v$NODE_VERSION-linux-x64.tar.gz" SHASUMS256.txt.asc && npm install -g npm@"$NPM_VERSION" && npm cache clear apt-get -y install autoconf automake build-essential libtool run curl -SLO http://libuv.org/dist/v1.0.0/libuv-v1.0.0.tar.gz && tar xvf libuv-v1.0.0.tar.gz && rm libuv-v1.0.0.tar.gz && cd libuv-v1.0.0 && sh ./autogen.sh && ./configure&& make && make install && cd .. && rm -rf libuv-v1.0.0 && ldconfig RUN npm install -g bower grunt-cli USER dev WORKDIR /home/dev
  • 28. Dockerfile – ADD / WORKDIR / RUN COPY WebApplication /app WORKDIR /app RUN ["dnu", "restore”]
  • 29. Dockerfile – EXPOSE / CMD EXPOSE 5000 CMD ["dnx", ".", "kestrel"]
  • 30. Example – ASP.NET vNext FROM benhall/aspnet-vnext-npm COPY WebApplication /app WORKDIR /app RUN ["dnu", "restore”] EXPOSE 5000 CMD ["dnx", ".", "kestrel"]
  • 31. Example - NancyFX FROM benhall/docker-mono COPY . /src WORKDIR /src RUN xbuild Nancy.Demo.Hosting.Docker.sln EXPOSE 8080 CMD ["mono", "src/bin/Nancy.Demo.Hosting.Docker.exe"]
  • 32. Example – Node.JS FROM node:0.10.38 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY package.json /usr/src/app/ RUN npm install COPY . /usr/src/app EXPOSE 3001 CMD [ "npm", "start" ]
  • 33. $ docker build --t === Friendly name. <Docker Hub Username>/<ProjectName>:<tag>
  • 35.
  • 36.
  • 37. > cat .dockerignore #Ignore file in root all_the_passwords.txt .git/ node_modules/ bower_components/
  • 39. $ docker ps -a === Show all containers
  • 40. > docker inspect elasticsearch "NetworkSettings": { "Bridge": "docker0", "Gateway": "172.17.42.1", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "IPAddress": "172.17.0.3", "IPPrefixLen": 16, "IPv6Gateway": "", "LinkLocalIPv6Address": "fe80::42:acff:fe11:3", "LinkLocalIPv6PrefixLen": 64, "MacAddress": "02:42:ac:11:00:03", "PortMapping": null }
  • 41. $ docker run –p $CONTAINERPORT
  • 42. > iptables -t nat -L –n Chain DOCKER (1 references) target prot opt source destination DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:49163 to:172.17.0.27:80 DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:49164 to:172.17.0.29:3000 DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:49165 to:172.17.0.30:80 DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:49166 to:172.17.0.31:3000 DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:49167 to:172.17.0.38:80 DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:49168 to:172.17.0.40:3000 DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 to:172.17.0.95:80
  • 43. > docker run -d #Run In Background -p 9200:9200 -p 9300:9300 #Bind Ports elasticsearch #Image Name https://www.dropbox.com/s/fbe8briq6ayycrh/start-elastic.gif?dl=0
  • 44. > curl b2d:9200 # b2d is my Boot2Docker VM https://www.dropbox.com/s/fbe8briq6ayycrh/start-elastic.gif?dl=0
  • 45. Recap • docker registry • docker run elasticsearch • Create Dockerfile • docker build –t image-name . • docker run image-name
  • 46. Go Lang > cat Dockerfile FROM golang:onbuild > cat Makefile NAME = ocelotuproar/docker-outdated build: docker build -t $(NAME) . run: docker run --rm --name $(INSTANCE) $(NAME) > make build # Run Golang Compiler & Build container > make run # Run built application
  • 47. Private NPM Repository https://github.com/BenHall/docker-local-npm- registry > docker run -d -v $(pwd)/config.yaml:/opt/sinopia/config.yaml -p 4873:4873 keyvanfatehi/sinopia:latest > npm set registry http://b2d:4873 > npm adduser --registry http://b2d:4873
  • 48. RStudio • docker run -d -p 8787:8787 rocker/rstudio
  • 50. Docker Push / Pull > docker run -p 5000:5000 registry:2.0 > docker push myreg:5000/benhall/aspnet:20150617140759 > docker pull myreg:5000/benhall/aspnet:20150617140759
  • 51. Persisting Data$ docker run –v <host-dir>:<container-dir> image -v /opt/docker/elasticsearch:/data -v /opt/docker/mysql:/var/lib/mysql -v /docker/scrapbook/uploads:/app/public/uploads -v $(PWD):/host -v /var/log/syslog:/var/log/syslog
  • 52.
  • 53. > docker run -d --restart=always # Restart if exits non-zero redis
  • 55. > docker run -d -p 9200:9200 -p 9300:9300 --name es # 1) Friendly Name elasticsearch > docker run –it –p 3000 --link es:elasticsearch #2) <container>:<alias> your-application > cat /etc/hosts 172.17.0.79 elasticsearch > env HOSTNAME=2f3b959b13a0 ELASTICSEARCH_PORT=tcp://172.17.0.79:9200 ELASTICSEARCH_PORT_9200_TCP=tcp://172.17.0.79:9200 ELASTICSEARCH_PORT_9200_TCP_ADDR=172.17.0.79 ELASTICSEARCH_PORT_9200_TCP_PORT=9200 ELASTICSEARCH_PORT_9200_TCP_PROTO=tcp ELASTICSEARCH_NAME=/scrapbookv2_web_1/es NODE_ENV=production
  • 56.
  • 57. Two Websites On Port 80?
  • 58. Nginx
  • 59.
  • 60. Problematic Approach > docker run -d --name nginx_root --link blog_benhall-1:blog_benhall-1 --link scrapbook-1:scrapbook-1 --link scrapbook_web_1:scrapbook_web_1 --link brownbag_web_1:brownbag_web_1 -p 80:80 -v /opt/docker/nginx/www:/data -v /opt/docker/nginx/sites:/etc/nginx/sites-enab -v /opt/docker/nginx/logs:/var/log/nginx dockerfile/nginx
  • 62.
  • 63. • -v /var/run/docker.sock:/tmp/docker.sock • VIRTUAL_HOST=my.container.com
  • 64. # HTTP 1.1 support proxy_http_version 1.1; proxy_buffering off; proxy_set_header Host $http_host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $proxy_connection; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto; upstream my.container.com { # agitated_hopper server 172.17.0.35:5001; } server { listen 80; server_name my.container.com; location / { proxy_pass http://my.container.com; } }
  • 65. > docker run -d --name blog_benhall_varnish --link blog_benhall:wordpress -e VIRTUAL_HOST=blog.benhall.me.uk -e VARNISH_BACKEND_PORT=80 -e VARNISH_BACKEND_HOST=wordpress benhall/docker-varnish Nginx Varnish blog_benhall_varnish Wordpress blog_benhall
  • 67.
  • 68. > cat docker-compose.yml web: # Container Name build: . # Build links: # Links - elasticsearch ports: # Ports - 3000 environment: # Environment VIRTUAL_HOST: 'app.joinscrapbook.com' NODE_ENV: 'production’ elasticsearch: # 2nd Container Name image: elasticsearch:1.5 # Use Image ports: # Ports - 9200:9200
  • 69. > docker-compose up # Start containers –d # In background Recreating scrapbookv2_nginx_1... Recreating scrapbookv2_redis_1... Recreating scrapbookv2_db_1... Recreating scrapbookv2_elasticsearch_1... Recreating scrapbookv2_web_1… > docker-compose stop # Stop containers Stopping scrapbookv2_web_1... Stopping scrapbookv2_elasticsearch_1... Stopping scrapbookv2_db_1... Stopping scrapbookv2_redis_1... Stopping scrapbookv2_nginx_1...
  • 70. Schema Management Containers > docker run –d # No need to bind ports --name es # Friendly Name dockerfile/elasticsearch > docker run –rm --link es:es # Link Container:alias myapp/schema:latest # Schema Image
  • 71. Sidekick Container For Testing > docker run –d # No need to bind ports --name es # Friendly Name dockerfile/elasticsearch > docker run –it --link es:es # Link Container:alias benhall/curl # Curl Image curl http://es:9200 # Ping service > echo $? # Exit Code 0 # Success
  • 72. FOUR AND MORE! SCALE!
  • 73.
  • 75. A Load Balanced ASP.NET/NancyFX/Node.js Website running inside Docker https://www.dropbox.com/s/gbcifo094c9v8ar/nancy-lb-demo-optimised.gif?dl=0
  • 76. 1) Docker raises events when containers start / stop 2) Registrator listens to events adds the new container’s details into Consul 3) Consul links container’s IP / Ports to DNS names & discovery API > ping redis.service.consul 4) Nginx uses Consul discovery API to write & load config
  • 78.
  • 81. Docker and Microsoft Partnership
  • 82. SQL Server as a Container?
  • 84. Visual Studio as a Container?
  • 85. Docker as a Platform
  • 86.
  • 89. Only tool I use for deployment • Close gap between development and production • Everything is a container! • Docker Machine, Compose & Swarm • Running platforms like Logstash, ElasticSearch, Redis, EventStore, RavenDB, NancyFX etc? Consider containers for deployment.
  • 90.

Notas do Editor

  1. Explain why, not how….
  2. $ cd ~/SourceControl/HelloWorldVNext $ cat Dockerfile $ docker build -t benhall/aspnetvnext . $ docker run -d -t -i -p 5000:5000 -e SQLSERVER=192.168.0.4 benhall/aspnetvnext $ curl 192.168.59.103:5000 <h1>Hello from Razor!!<h1> <h2>From 95a28c090686</h2>