Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.
Docker in Production
by Robert Lemke
Robert Lemke
CEO Flownative

Project Founder Neos



robert@flownative.com

@robertlemke
Docker
Toolbox
www.docker.com/docker-toolbox
Docker =
better VM for dev
Docker
}dev
staging
production
more than that?
what's different
in production?
monitoring
deployment
debugging
security
backup
Host
which
operating
system
?
provis
ioning
Docker
Machine
resource "aws_instance" "www1" {

ami = "${lookup(var.amis, var.region)}"

availability_zone = "${var.region}a"

instance_...
images
use your own
images
base image
security!
size
fitness
private
repositories
hub.docker.com

quay.io

Google Cloud

AWS (planned)
sudo docker build -t beta.gcr.io/myproject/nginx:$BUILD_ID .
sudo docker tag -f beta.gcr.io/myproject/nginx:$BUILD_ID beta...
persist
ent
data
host volume
other storages
data-only containers
orches
tration
Docker Compose
decouple for deployment
nginx:

image: flownative/nginx:latest

external_links:

- cargo_jenkins_1

ports:

- "443:443"

v...
Service
Discovery
-> Nginx: new
website
deploy
ment
#!/bin/bash



ssh ubuntu@foo.flownative.net mkdir -p /home/ubuntu/docker



ssh ubuntu@foo.flownative.net "cd ~/docker; s...
apiVersion: v1

kind: ReplicationController

metadata:

name: "neos-wwwneosio-elasticsearch-1"

spec:

replicas: 1



sele...
apiVersion: v1

kind: Service

metadata:

name: elasticsearch-628f1e05

labels:

account: "neos"

project: "wwwneosio"

st...
immutable
hardware
monito
ring
Docker stats
docker stats $(docker ps | awk '{if(NR>1) print $NF}')
tips&tricks
PaaS?

your
own?
what do you want
to work on?



Host maintenance?
Where to start?
develop images locally
use Docker compose
deploy with a script + Docker compose
start using Tutum / Giant Swarm
look into ...
Containers will
fundamentally
change the way we
ship web
applications.
robert@flownative.com
www.flownative.com
@robertlemke
share your
thoughts
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Docker in Production - IPC 15 München
Nächste SlideShare
Wird geladen in …5
×

Docker in Production - IPC 15 München

1.055 Aufrufe

Veröffentlicht am

You've heard about Docker, maybe you use it already as a development environment for virtualising your project on your local machine. But running your application or website with Docker in production is a whole different deal. In this session you'll get a deeper insight into working with Docker in practice. Starting with the 101 of concepts we'll go through a practical scenario for hosting, automatically deploying and monitoring an application in production.

Veröffentlicht in: Technologie
  • Als Erste(r) kommentieren

Docker in Production - IPC 15 München

  1. 1. Docker in Production by Robert Lemke
  2. 2. Robert Lemke CEO Flownative
 Project Founder Neos
 
 robert@flownative.com
 @robertlemke
  3. 3. Docker Toolbox www.docker.com/docker-toolbox
  4. 4. Docker = better VM for dev
  5. 5. Docker }dev staging production
  6. 6. more than that?
  7. 7. what's different in production?
  8. 8. monitoring deployment debugging security backup
  9. 9. Host
  10. 10. which operating system ?
  11. 11. provis ioning
  12. 12. Docker Machine
  13. 13. resource "aws_instance" "www1" {
 ami = "${lookup(var.amis, var.region)}"
 availability_zone = "${var.region}a"
 instance_type = "t2.micro"
 subnet_id = "${aws_subnet.kubenet_craft.id}"
 associate_public_ip_address = true
 
 tags {
 Name = "www1.${var.regioncode}.flownative.net"
 }
 }
 
 resource "aws_route53_record" "kubemaster" {
 zone_id = "${var.flownativenet_zone_id}"
 name = "www1.${var.regioncode}"
 type = "A"
 ttl = "60"
 records = [
 "${aws_instance.www1.private_ip}"]
 }

  14. 14. images
  15. 15. use your own images
  16. 16. base image security! size fitness
  17. 17. private repositories hub.docker.com
 quay.io
 Google Cloud
 AWS (planned)
  18. 18. sudo docker build -t beta.gcr.io/myproject/nginx:$BUILD_ID . sudo docker tag -f beta.gcr.io/myproject/nginx:$BUILD_ID beta.gcr.io/myproject/nginx sudo docker login -u _json_key -p "$(cat …json)" -e x@y.com https://beta.gcr.io sudo docker push beta.gcr.io/myproject/nginx:latest sudo docker push beta.gcr.io/myproject/nginx:$BUILD_ID
  19. 19. persist ent data
  20. 20. host volume other storages data-only containers
  21. 21. orches tration
  22. 22. Docker Compose
  23. 23. decouple for deployment nginx:
 image: flownative/nginx:latest
 external_links:
 - cargo_jenkins_1
 ports:
 - "443:443"
 volumes:
 - data/certs/STAR_flownative_com.key:/etc/nginx/certs/flownative/docker-registry/STAR_flownative_com.key - data/certs/STAR_flownative_com-ssl-bundle.crt:/etc/nginx/certs/flownative/docker-registry/ STAR_flownative_com-ssl-bundle.crt
 volumes_from:
 - cargo_jenkins_1
 restart: always
 jenkins:
 build: "docker-jenkins"
 restart: always
 volumes:
 - data/jenkins:/var/jenkins_home
 - /var/run/docker.sock:/var/run/docker.sock
 - /usr/bin/docker:/usr/bin/docker
 ports:
 - "8080:8080"

  24. 24. Service Discovery -> Nginx: new website
  25. 25. deploy ment
  26. 26. #!/bin/bash
 
 ssh ubuntu@foo.flownative.net mkdir -p /home/ubuntu/docker
 
 ssh ubuntu@foo.flownative.net "cd ~/docker; sudo docker-compose -p cargo -f docker-compose-nginx.yml stop"
 ssh ubuntu@foo.flownative.net "cd ~/docker; sudo docker-compose -p cargo -f docker-compose-nginx.yml rm -f"
 
 scp ./docker-compose-nginx.yml ubuntu@cargo.flownative.net:/home/ubuntu/docker/
 
 ssh ubuntu@foo.flownative.net "cd ~/docker; sudo docker-compose -p cargo -f docker-compose-nginx.yml build"
 ssh ubuntu@foo.flownative.net "cd ~/docker; sudo docker-compose -p cargo -f docker-compose-nginx.yml up -d"

  27. 27. apiVersion: v1
 kind: ReplicationController
 metadata:
 name: "neos-wwwneosio-elasticsearch-1"
 spec:
 replicas: 1
 
 selector:
 account: "neos"
 project: "wwwneosio"
 stage: "production"
 type: "elasticsearch"
 version: "1"
 
 template:
 metadata:
 
 labels:
 account: "neos"
 project: "wwwneosio"
 stage: "production"
 type: "elasticsearch"
 version: "1"
 
 spec:
 containers:
 
 - name: elasticsearch
 image: docker.flownative.com/flownative/elasticsearch:1
 ports:
 - containerPort: 9200
 resources:
 requests:
 memory: "100Mi"
 cpu: "10m"
 limits:
 memory: "800Mi"
 cpu: "500m"
 env:
 - name: ELASTICSEARCH_CLUSTER_NAME
 value: "neos-wwwneosio"

  28. 28. apiVersion: v1
 kind: Service
 metadata:
 name: elasticsearch-628f1e05
 labels:
 account: "neos"
 project: "wwwneosio"
 stage: "production"
 type: "elasticsearchmaster"
 spec:
 type: NodePort
 ports:
 - name: elasticsearchrestapi
 port: 9200
 targetPort: 9200
 - name: elasticsearchtransport
 port: 9300
 targetPort: 9300
 selector:
 account: "neos"
 project: "wwwneosio"
 stage: "production"
 type: "elasticsearchmaster"

  29. 29. immutable hardware
  30. 30. monito ring
  31. 31. Docker stats docker stats $(docker ps | awk '{if(NR>1) print $NF}')
  32. 32. tips&tricks
  33. 33. PaaS?
 your own?
  34. 34. what do you want to work on?
 
 Host maintenance?
  35. 35. Where to start?
  36. 36. develop images locally use Docker compose deploy with a script + Docker compose start using Tutum / Giant Swarm look into Kubernetes on Google Cloud rehearse backup, monitoring, debugging 
 ~ Docker in Production
  37. 37. Containers will fundamentally change the way we ship web applications.
  38. 38. robert@flownative.com www.flownative.com @robertlemke share your thoughts

×