SlideShare a Scribd company logo
Docker for Developers
ANDRZEJ SYDOR
Docker
 Docker is the leading software container platform
 Founded in 2013 as Linux developer tool
 Fundamentally solves the „works on my machine” problem
 Container industry inventor, leader and innovative
 Transform app and infrastructure security, portability, agility and efficiency
One Application on
One Physical Server
 Limitations
 Slow development times
 Huge costs
 Wasted resources
 Difficult to scale
 Difficult to migrate
 Vendor lock in
Hypervisior – Based
Virtualization
 Benefit:
 Better resource pooling
 One physical machine divided into multiple virtual machines
 Easier to scale
 VMs in the cloud
 Rapid elasticity
 Pay as you go model
 Limitations:
 Each VM stills requires:
 CPU limitations
 Storage
 RAM
 An entire guest operating system
 Full guest OS means wasted resources
 Application portability not guaranteed
Docker
 Standarized packaging for software and
dependencies
 Isolate apps from each other
 Share the same OS kernel
 Works with all major Linux and Windows
Server
Docker for developers
Key Benefits of Docker Containers
 Speed
 No OS to boot – applications online in seconds
 Portability
 Less dependencies between proces layers = ability to move between
infrastructure
 Efficiency
 Less OS overhead
 Improved resource efficiency
WORA / PODA
 WORA = Write Once Run Anywhere {J,W,E}AR
 PODA = Package Once Deploy Anywhere
Docker
 Image
 The basis of a Docker container
 Registry
 Stores, distributes and manages Docker images
 Container
 The image when it is ‚running’
 Swarm Cluster
 Cluster of Docker hosts
 Control Pane
 Management plane for container and cluster orchestration
Docker
 Docker Compose
 Define and share multi-container definitions
 Docker Machine
 A tool to launch Docker hosts on multiple platforms
 Docker Hub
 Repository for Docker Images
 Docker Store
 A storefront for official Docker images and plugins as well as licensed products
 Docker Swarm
 A multi-host-aware orchestration tool
 Docker Cloud
 Docker’s Container as a Service (CaaS)
Docker Images Layers
 Layers are read only
 An image is a collection of files and some
meta data
 Images are comprised of multiple layers
 A layer is also contains software you want
to run
 Each image contains a base layer
 Every image contains a base layer
 Docker uses a copy on write systems
Docker Sharing Layers
 Images can share layers in order to speed up transfer times and optimize
disk and memory usage
 Parent images that already exists on the host do not have to be
downloaded
Portainer
 Docker UI
 „The easiest way to manage docker”
 https://www.portainer.io/
Portainer
docker volume create portainer_data
docker run –name=portainer
-d -p 9000:9000 --restart always
-v /var/run/docker.sock:/var/run/docker.sock
-v /opt/portainer:/data portainer/portainer
Portainer
 https://portainer.io/overview.html
 Detailed overview
 Containers (List, Details, Stats, Logs, Console, Creation)
 Images (List, Details)
 Network (List)
 Volumes (List)
 Container Templates
 Cluster overview
 Services Management
 Endpoint Management
 User Management and User Access Control
Kitematic
 Visual Docker Container Management on Mac & Windows
 Run containers through a simple, yet powerful graphical user interface.
 https://kitematic.com/
 Legacy desktop solution boundled with Docker Toolbox.
Kitematic
 Fast and Easy Setup
 Docker Hub Integration
 Seamless Experience Between CLI and GUI
 Advantaged Features
 Automatically map ports
 Configuring volumes
 Change environment variables
 Streamline logs
 CLI access to containers
Kitematic
Docker Desktop for Windows
 Docker Desktop for Windows is the best way to get started with Docker on
Windows
 https://docs.docker.com/docker-for-windows/
 Native application on UI
 Auto update capability
 No additional software required, e.g. Virtualbox
 Windows: Hyper-V VM
 Better networking and filesystem mounting/notification
 Requires Windows 10 64-bit (Yosemite 10.10+)
Rancher OS
 A simplified Linux distribution build from containers, for containers.
 https://rancher.com/rancher-os/
 https://github.com/rancher/os
Build Container Images
 Dockerfile
 FROM – Docker base
 FROM alpine:latest
 LABEL – extra information
 LABEL maintainer = ‘”Andrzej Sydor”
 RUN – commands to install software and run scripts
 RUN mkdir –p /tmp/myapp/
 COPY/ADD
 COPY build/app.jar /etc/app.jar
 ADD http://resource/files/html.tar.gz /usr/share/nginx/
 EXPOSE – the port and the protocol exposed in runtime
 EXPOSE 80/tcp
 ENTRYPOINT/CMD
 USER / WORKDIR / ONBUILD / ENV
Docker Build
 docker image build –file <Dockerfile> --tag <REPO>:<TAG>
 <REPO> - typically username on Docker Hub
 <TAG> - unique container value
 docker image build --tag local:dockerfile-example .
 .(dot) – current folder
Storing images
 Docker Registry
Docker Hub
Docker Store
Docker Registry
 Service that storing your Docker images
 Open source – Apache license
 Tightly control where your images are being stored
 Fully own your images distribution pipeline
 Integrate image storage and distribution tightly into your in-house development
Filesystem
/var/lib/registry
Storing images
 Docker Hub
 Free for public images
 Organizations
 Repository
 Automated build (GitHub, BitBucket)
Storing images
 Docker Store
 Docker images and plugins
 Docker Certified
Third-party registries
 Red Hat Container Catalog
 OpenShift
 Jfrog
 Quay.io
 Amazon EC2 Container Registry
 Others: Microbadger e.g. inspect image
Networking & Volumes
 IPAM (IP address management)
 Planning, tracking and managing IP addressess within the network
 IPAM has DNS and DHCP services
Docker – CPU/Memory
 By default, a container can consume all available resources on the host
machine if it requires it
 Limit CPU usage
 -c / --cpu-shares=1024
 --cpu-period=25000 (microseconds)
 --cpu-quota=25000 (microseconds)
 Limit memory usage
 --memory 1024M
 --memory-swap 1024M
 By default, when you set --memory, docker will set the --memory-swap size twice
 --kernel-swap 1024M
Docker Security Scanning
 Security Scanning feature (Non Free):
 Docker Hub
 Docker Cloud
Docker Security non-events
 https://docs.docker.com/engine/security/non-events/
 CVE-2013-1956, 1957, 1958, 1959, 1979, CVE-2014-
4014, 5206, 5207, 7970, 7975,CVE-2015-2925, 8543, CVE-2016-3134, 3135,
 CVE-2014-0181, CVE-2015-3339
 CVE-2014-4699
 CVE-2014-9529
 CVE-2015-3214, 4036
 CVE-2016-0728
 CVE-2016-2383
 CVE-2016-3134, 4997, 4998
Docker Security Scanning
 https://docs.docker.com/docker-cloud/builds/image-scan/
 Free for Docker Cloud users
 Clair
 free
 Peekr
 Atomic Scan
 docker diff
 docker run --read-only …
 docker run -v directory:/directory:ro ..
Docker Bench Security - examples
 Host configuration
 [WARN] 1.1 – Create a separate partition for containers
 [WARN] 1.5 – Audit Docker daemon - /usr/bin/docker
 [WARN] 1.6 – Audit Docker files and directories - /var/lib/docker
 [WARN] 1.7 – Audit Docker files and directories - /etc/docker
 [WARN] 1.8 – Audit Docker files and directories - /etc/default/docker
Docker Bench Security - examples
 Docker daemon configuration
 [WARN] 2.1 – Restrict network traffic between containers
 [WARN] 2.8 – Enable user namespace support
 [WARN] 2.11 – Use Authorization plugin
 [WARN] 2.12 – Configure centralized and remote logging
 [WARN] 2.13 – Disable operations on legacy registry (v1)
 [WARN] 2.14 – Enable live restore
 [WARN] 2.18 – Disable Userland Proxy
Docker Bench Security - examples
 Docker daemon configuration files
 Container images and build files
 [WARN] 4.1 – Create a user and build files
 [WARN] 4.5 – Enable Content trust for Docker
 [WARN] 4.6 – Add HEALTHCHECK instruction to the container image
Docker Bench Security - examples
 Container runtime
 [WARN] 5.2 – Verify SELinux security options, if applicable
 [PASS] – 5.1 – Do not disable AppArmor Profile
 [WARN] 5.4 – Do not use privileged containers
 [WARN] 5.6 – Do not run ssh within containers
 [WARN] 5.10 – Limit memory usage for container
 [WARN] 5.11 – Set container CPU priority appriopriately
 [WARN] 5.12 – Mount container’s root files as read only
 [WARN] 5.13 – Bind incoming container traffic to a specific host interface
 [WARN] 5.14 – Set the ‘on-failure’ container restart policy to 5
Docker Bench Security - examples
 Docker security operations
 [INFO] 6.1 – Perform regular security audits of your host system and containers
 [INFO] 6.2 – Monitor Docker container usage, performance and metering
 [INFO] 6.3 – Backup container data
 [INFO] 6.4 – Avoid image sprawl
 [INFO] 6.5 – Avoid container sprawl
Third Party Security services
 Quay
 https://quay.io/
 Clair
 https://github.com/coreos/clair/
Docker Swarm
 Docker Clusters
 Distribute containers across multiple hosts
 Scale Containers
 Docker Swarm standalone ended suport for version 1.11 in the first quarter
in 2017
 Docker 1.12 introduced Docker Swarm mode
 All function introduced
Docker Swarm Roles
 Swarm Manager
 Central management point of all Swarm hosts
 Commands to control nodes: switch between nodes, join nodes, remove
nodes, manipulate hosts
 Each cluster can run several Swarm managers
 Recomended run a minimum of five Swarm managers (two noes failure before start
have any errors)
 Swarm Worker
 Run docker containers
Docker - best practices
 One application per container
 Only install what you need
 Review who has access to your Docker hosts
 Use the latest version
 Use the resources
Docker Bench Security
 https://github.com/docker/docker-bench-security
 The Docker Bench Security is a script that checks for dozens of common
best-practices around deploying Docker containers in production
 The tool will inspect:
 The host configuration
 The docker daemon configuration
 The docker daemon configuration files
 Container images and build files
 Container runtime
 The docker security operations
Tools
 cAdvisor https://github.com/google/cadvisor/
 Analyzes resource usage and performance characteristics of running
containers
 Node-exporter https://github.com/prometheus/node_exporter/
 Exporter for machine metrics http://prometheus.io/
 Prometheus https://prometheus.io/
 Power your metrics and alerting with a leading open-source monitoring solution
 Grafana https://grafana.com/
 The open platform for beautiful analytics and monitoring
Links
 https://labs.play-with-docker.com/
 https://training.play-with-docker.com
 https://cloud.docker.com
 https://docs.docker.com/develop/develop-images/dockerfile_best-
practices
 https://circleci.com/pricing/
 https://app.codeship.com/

More Related Content

PPTX
Docker Understanding, What is Docker? Why Docker? How do I containerize somet...
PDF
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
ODP
Docker - The Linux Container
PDF
Introduction to docker
PDF
Docker Container Introduction
PPTX
Architecting .NET Applications for Docker and Container Based Deployments
PDF
docker installation and basics
PDF
Introduction to container based virtualization with docker
Docker Understanding, What is Docker? Why Docker? How do I containerize somet...
Docker Commands With Examples | Docker Tutorial | DevOps Tutorial | Docker Tr...
Docker - The Linux Container
Introduction to docker
Docker Container Introduction
Architecting .NET Applications for Docker and Container Based Deployments
docker installation and basics
Introduction to container based virtualization with docker

What's hot (20)

PPTX
Docker : Container Virtualization
PDF
Docker HK Meetup - 201707
PPTX
Docker container a-brief_introduction_2016-01-30
PPTX
Docker 101 - High level introduction to docker
PDF
Introduction to Docker - VIT Campus
PDF
Docker, the Future of DevOps
PDF
Introduction To Docker
PDF
Docker Overview - Rise of the Containers
PPTX
Docker introduction for the beginners
PPTX
PDF
Learning Docker with Thomas
PPTX
Docker, LinuX Container
PDF
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
PPTX
Introduction to docker
PPTX
Docker Introductory workshop
PPTX
Why Docker
PDF
Introduction to Docker
PPT
Docker introduction
PPTX
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
PDF
Docker Introduction
Docker : Container Virtualization
Docker HK Meetup - 201707
Docker container a-brief_introduction_2016-01-30
Docker 101 - High level introduction to docker
Introduction to Docker - VIT Campus
Docker, the Future of DevOps
Introduction To Docker
Docker Overview - Rise of the Containers
Docker introduction for the beginners
Learning Docker with Thomas
Docker, LinuX Container
What is Docker | Docker Tutorial for Beginners | Docker Container | DevOps To...
Introduction to docker
Docker Introductory workshop
Why Docker
Introduction to Docker
Docker introduction
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
Docker Introduction
Ad

Similar to Docker for developers (20)

PPTX
Docker for developers z java
PDF
Introduction to Docker and Monitoring with InfluxData
PPTX
You, and Me, and Docker Makes Three
PPTX
Docker In Brief
PPTX
Docker Starter Pack
PDF
Docker-v3.pdf
PPTX
[Codelab 2017] Docker 기초 및 활용 방안
PDF
docker.pdf
PDF
Docker Tutorial.pdf
PDF
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ
PDF
Up and running with docker
PPT
Containers 101
PPTX
Docker and kubernetes
PDF
Work shop - an introduction to the docker ecosystem
PPTX
Introducing & playing with Docker | Manel Martinez | 1st Docker Crete Meetup
PPTX
"Docker best practice", Станислав Коленкин (senior devops, DataArt)
PDF
Containerization using docker
PDF
Docker 0.11 at MaxCDN meetup in Los Angeles
PDF
Docker in real life
PPTX
Virtualization, Containers, Docker and scalable container management services
Docker for developers z java
Introduction to Docker and Monitoring with InfluxData
You, and Me, and Docker Makes Three
Docker In Brief
Docker Starter Pack
Docker-v3.pdf
[Codelab 2017] Docker 기초 및 활용 방안
docker.pdf
Docker Tutorial.pdf
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ
Up and running with docker
Containers 101
Docker and kubernetes
Work shop - an introduction to the docker ecosystem
Introducing & playing with Docker | Manel Martinez | 1st Docker Crete Meetup
"Docker best practice", Станислав Коленкин (senior devops, DataArt)
Containerization using docker
Docker 0.11 at MaxCDN meetup in Los Angeles
Docker in real life
Virtualization, Containers, Docker and scalable container management services
Ad

Recently uploaded (20)

PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
CH1 Production IntroductoryConcepts.pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Digital Logic Computer Design lecture notes
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
DOCX
573137875-Attendance-Management-System-original
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PPT
Project quality management in manufacturing
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
additive manufacturing of ss316l using mig welding
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Model Code of Practice - Construction Work - 21102022 .pdf
CH1 Production IntroductoryConcepts.pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Digital Logic Computer Design lecture notes
OOP with Java - Java Introduction (Basics)
UNIT-1 - COAL BASED THERMAL POWER PLANTS
573137875-Attendance-Management-System-original
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Lesson 3_Tessellation.pptx finite Mathematics
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Lecture Notes Electrical Wiring System Components
Strings in CPP - Strings in C++ are sequences of characters used to store and...
Project quality management in manufacturing
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Operating System & Kernel Study Guide-1 - converted.pdf
additive manufacturing of ss316l using mig welding

Docker for developers

  • 2. Docker  Docker is the leading software container platform  Founded in 2013 as Linux developer tool  Fundamentally solves the „works on my machine” problem  Container industry inventor, leader and innovative  Transform app and infrastructure security, portability, agility and efficiency
  • 3. One Application on One Physical Server  Limitations  Slow development times  Huge costs  Wasted resources  Difficult to scale  Difficult to migrate  Vendor lock in
  • 4. Hypervisior – Based Virtualization  Benefit:  Better resource pooling  One physical machine divided into multiple virtual machines  Easier to scale  VMs in the cloud  Rapid elasticity  Pay as you go model  Limitations:  Each VM stills requires:  CPU limitations  Storage  RAM  An entire guest operating system  Full guest OS means wasted resources  Application portability not guaranteed
  • 5. Docker  Standarized packaging for software and dependencies  Isolate apps from each other  Share the same OS kernel  Works with all major Linux and Windows Server
  • 7. Key Benefits of Docker Containers  Speed  No OS to boot – applications online in seconds  Portability  Less dependencies between proces layers = ability to move between infrastructure  Efficiency  Less OS overhead  Improved resource efficiency
  • 8. WORA / PODA  WORA = Write Once Run Anywhere {J,W,E}AR  PODA = Package Once Deploy Anywhere
  • 9. Docker  Image  The basis of a Docker container  Registry  Stores, distributes and manages Docker images  Container  The image when it is ‚running’  Swarm Cluster  Cluster of Docker hosts  Control Pane  Management plane for container and cluster orchestration
  • 10. Docker  Docker Compose  Define and share multi-container definitions  Docker Machine  A tool to launch Docker hosts on multiple platforms  Docker Hub  Repository for Docker Images  Docker Store  A storefront for official Docker images and plugins as well as licensed products  Docker Swarm  A multi-host-aware orchestration tool  Docker Cloud  Docker’s Container as a Service (CaaS)
  • 11. Docker Images Layers  Layers are read only  An image is a collection of files and some meta data  Images are comprised of multiple layers  A layer is also contains software you want to run  Each image contains a base layer  Every image contains a base layer  Docker uses a copy on write systems
  • 12. Docker Sharing Layers  Images can share layers in order to speed up transfer times and optimize disk and memory usage  Parent images that already exists on the host do not have to be downloaded
  • 13. Portainer  Docker UI  „The easiest way to manage docker”  https://www.portainer.io/
  • 14. Portainer docker volume create portainer_data docker run –name=portainer -d -p 9000:9000 --restart always -v /var/run/docker.sock:/var/run/docker.sock -v /opt/portainer:/data portainer/portainer
  • 15. Portainer  https://portainer.io/overview.html  Detailed overview  Containers (List, Details, Stats, Logs, Console, Creation)  Images (List, Details)  Network (List)  Volumes (List)  Container Templates  Cluster overview  Services Management  Endpoint Management  User Management and User Access Control
  • 16. Kitematic  Visual Docker Container Management on Mac & Windows  Run containers through a simple, yet powerful graphical user interface.  https://kitematic.com/  Legacy desktop solution boundled with Docker Toolbox.
  • 17. Kitematic  Fast and Easy Setup  Docker Hub Integration  Seamless Experience Between CLI and GUI  Advantaged Features  Automatically map ports  Configuring volumes  Change environment variables  Streamline logs  CLI access to containers
  • 19. Docker Desktop for Windows  Docker Desktop for Windows is the best way to get started with Docker on Windows  https://docs.docker.com/docker-for-windows/  Native application on UI  Auto update capability  No additional software required, e.g. Virtualbox  Windows: Hyper-V VM  Better networking and filesystem mounting/notification  Requires Windows 10 64-bit (Yosemite 10.10+)
  • 20. Rancher OS  A simplified Linux distribution build from containers, for containers.  https://rancher.com/rancher-os/  https://github.com/rancher/os
  • 21. Build Container Images  Dockerfile  FROM – Docker base  FROM alpine:latest  LABEL – extra information  LABEL maintainer = ‘”Andrzej Sydor”  RUN – commands to install software and run scripts  RUN mkdir –p /tmp/myapp/  COPY/ADD  COPY build/app.jar /etc/app.jar  ADD http://resource/files/html.tar.gz /usr/share/nginx/  EXPOSE – the port and the protocol exposed in runtime  EXPOSE 80/tcp  ENTRYPOINT/CMD  USER / WORKDIR / ONBUILD / ENV
  • 22. Docker Build  docker image build –file <Dockerfile> --tag <REPO>:<TAG>  <REPO> - typically username on Docker Hub  <TAG> - unique container value  docker image build --tag local:dockerfile-example .  .(dot) – current folder
  • 23. Storing images  Docker Registry Docker Hub Docker Store
  • 24. Docker Registry  Service that storing your Docker images  Open source – Apache license  Tightly control where your images are being stored  Fully own your images distribution pipeline  Integrate image storage and distribution tightly into your in-house development Filesystem /var/lib/registry
  • 25. Storing images  Docker Hub  Free for public images  Organizations  Repository  Automated build (GitHub, BitBucket)
  • 26. Storing images  Docker Store  Docker images and plugins  Docker Certified
  • 27. Third-party registries  Red Hat Container Catalog  OpenShift  Jfrog  Quay.io  Amazon EC2 Container Registry  Others: Microbadger e.g. inspect image
  • 28. Networking & Volumes  IPAM (IP address management)  Planning, tracking and managing IP addressess within the network  IPAM has DNS and DHCP services
  • 29. Docker – CPU/Memory  By default, a container can consume all available resources on the host machine if it requires it  Limit CPU usage  -c / --cpu-shares=1024  --cpu-period=25000 (microseconds)  --cpu-quota=25000 (microseconds)  Limit memory usage  --memory 1024M  --memory-swap 1024M  By default, when you set --memory, docker will set the --memory-swap size twice  --kernel-swap 1024M
  • 30. Docker Security Scanning  Security Scanning feature (Non Free):  Docker Hub  Docker Cloud
  • 31. Docker Security non-events  https://docs.docker.com/engine/security/non-events/  CVE-2013-1956, 1957, 1958, 1959, 1979, CVE-2014- 4014, 5206, 5207, 7970, 7975,CVE-2015-2925, 8543, CVE-2016-3134, 3135,  CVE-2014-0181, CVE-2015-3339  CVE-2014-4699  CVE-2014-9529  CVE-2015-3214, 4036  CVE-2016-0728  CVE-2016-2383  CVE-2016-3134, 4997, 4998
  • 32. Docker Security Scanning  https://docs.docker.com/docker-cloud/builds/image-scan/  Free for Docker Cloud users  Clair  free  Peekr  Atomic Scan  docker diff  docker run --read-only …  docker run -v directory:/directory:ro ..
  • 33. Docker Bench Security - examples  Host configuration  [WARN] 1.1 – Create a separate partition for containers  [WARN] 1.5 – Audit Docker daemon - /usr/bin/docker  [WARN] 1.6 – Audit Docker files and directories - /var/lib/docker  [WARN] 1.7 – Audit Docker files and directories - /etc/docker  [WARN] 1.8 – Audit Docker files and directories - /etc/default/docker
  • 34. Docker Bench Security - examples  Docker daemon configuration  [WARN] 2.1 – Restrict network traffic between containers  [WARN] 2.8 – Enable user namespace support  [WARN] 2.11 – Use Authorization plugin  [WARN] 2.12 – Configure centralized and remote logging  [WARN] 2.13 – Disable operations on legacy registry (v1)  [WARN] 2.14 – Enable live restore  [WARN] 2.18 – Disable Userland Proxy
  • 35. Docker Bench Security - examples  Docker daemon configuration files  Container images and build files  [WARN] 4.1 – Create a user and build files  [WARN] 4.5 – Enable Content trust for Docker  [WARN] 4.6 – Add HEALTHCHECK instruction to the container image
  • 36. Docker Bench Security - examples  Container runtime  [WARN] 5.2 – Verify SELinux security options, if applicable  [PASS] – 5.1 – Do not disable AppArmor Profile  [WARN] 5.4 – Do not use privileged containers  [WARN] 5.6 – Do not run ssh within containers  [WARN] 5.10 – Limit memory usage for container  [WARN] 5.11 – Set container CPU priority appriopriately  [WARN] 5.12 – Mount container’s root files as read only  [WARN] 5.13 – Bind incoming container traffic to a specific host interface  [WARN] 5.14 – Set the ‘on-failure’ container restart policy to 5
  • 37. Docker Bench Security - examples  Docker security operations  [INFO] 6.1 – Perform regular security audits of your host system and containers  [INFO] 6.2 – Monitor Docker container usage, performance and metering  [INFO] 6.3 – Backup container data  [INFO] 6.4 – Avoid image sprawl  [INFO] 6.5 – Avoid container sprawl
  • 38. Third Party Security services  Quay  https://quay.io/  Clair  https://github.com/coreos/clair/
  • 39. Docker Swarm  Docker Clusters  Distribute containers across multiple hosts  Scale Containers  Docker Swarm standalone ended suport for version 1.11 in the first quarter in 2017  Docker 1.12 introduced Docker Swarm mode  All function introduced
  • 40. Docker Swarm Roles  Swarm Manager  Central management point of all Swarm hosts  Commands to control nodes: switch between nodes, join nodes, remove nodes, manipulate hosts  Each cluster can run several Swarm managers  Recomended run a minimum of five Swarm managers (two noes failure before start have any errors)  Swarm Worker  Run docker containers
  • 41. Docker - best practices  One application per container  Only install what you need  Review who has access to your Docker hosts  Use the latest version  Use the resources
  • 42. Docker Bench Security  https://github.com/docker/docker-bench-security  The Docker Bench Security is a script that checks for dozens of common best-practices around deploying Docker containers in production  The tool will inspect:  The host configuration  The docker daemon configuration  The docker daemon configuration files  Container images and build files  Container runtime  The docker security operations
  • 43. Tools  cAdvisor https://github.com/google/cadvisor/  Analyzes resource usage and performance characteristics of running containers  Node-exporter https://github.com/prometheus/node_exporter/  Exporter for machine metrics http://prometheus.io/  Prometheus https://prometheus.io/  Power your metrics and alerting with a leading open-source monitoring solution  Grafana https://grafana.com/  The open platform for beautiful analytics and monitoring
  • 44. Links  https://labs.play-with-docker.com/  https://training.play-with-docker.com  https://cloud.docker.com  https://docs.docker.com/develop/develop-images/dockerfile_best- practices  https://circleci.com/pricing/  https://app.codeship.com/