2
Most read
3
Most read
4
Most read
Docker Introduction
Tomasz Kopczynski
Sparkbit
Classic Deployments
Several environments
Dev
Test
QA
Production
Common problems:
Environments not equal to each other (OS, hardware, software versions)
Resources not utilized
Different installation procedures for each environment
www.sparkbit.pl
Docker Overview
• Lightweight containers
• Share OS with host (only user space is separate)
• Can be started in seconds
• One container = one application
• One system can be built with many containers
• Stateless containers
• Storage containers
• Can be wired together by using docker-compose
www.sparkbit.pl
Docker Architecture
• Docker container is an application with all of its dependencies
• Compared to traditional VM:
• No Hypervisor
• No Guest OS
• Containers are isolated
www.sparkbit.pl
Docker Dictionary
• Image – read only snapshot used to build a container
• Container – runtime environment built using an image
• Dockerfile – recipe on how to create an image
• Registry – public or private service for storing images
• DockerHub https://hub.docker.com/ - official public registry, like
GitHub for docker images
www.sparkbit.pl
Dockerfile
• Sample app: https://github.com/tkopczynski/spring-boot-docker
• Application should be run by a single command
• Application should run on linux
• Dockerfile:
FROM java:8 # Define base image
ADD target/spring-boot-docker.jar spring-boot-docker.jar # Copy application
into the image
CMD java –jar /spring-boot-docker.jar # Execute application
www.sparkbit.pl
Predefined Images
• DockerHub offers predefined images with many well-known
applications
• docker run -–name mysql –e MYSQL_ROOT_PASSWORD=root –d –p
3306:3306 mysql
• mysql –u root –p –H 127.0.0.1 –P 3306
• docker run –-name solr –d –p 8983:8983 –t solr
• http://localhost:8983
• And many, many more...
www.sparkbit.pl
Docker Use Cases
• Integration with continuous delivery process
• Automatically building images and pushing them to the registry
• Standardized environments
• Application doesn’t require anything outside of the container so it is always
executed in the same environment
• Microservices architecture
• Manage all microservices as docker images regardless of their technologies
and dependencies
• Scaling
• It is possible to automatically spin up new containers during traffic volume
peaks
www.sparkbit.pl
Docker in Continuous Delivery
• After commiting to version control, CI server builds an image with the
new version of the application
• Container based on that image is tested
• If tests pass, it is deployed to test, QA and production environments
with the same installation procedure
www.sparkbit.pl
Docker in Continuous Delivery
www.sparkbit.pl
Docker in The Cloud
• Some of the providers:
• Amazon EC2 Container Service
• Google Container Engine (based on Kubernetes)
• Tutum
• Docker VM Extension in Azure
www.sparkbit.pl
Summary
• Docker is a technology aimed at simplifying DevOps tasks
• Build once, ship and run anywhere principle
• Lightweight containers
• Easily integrated with continuous delivery process and cloud
infrastructure
www.sparkbit.pl

Docker Introduction

  • 1.
  • 2.
    Classic Deployments Several environments Dev Test QA Production Commonproblems: Environments not equal to each other (OS, hardware, software versions) Resources not utilized Different installation procedures for each environment www.sparkbit.pl
  • 3.
    Docker Overview • Lightweightcontainers • Share OS with host (only user space is separate) • Can be started in seconds • One container = one application • One system can be built with many containers • Stateless containers • Storage containers • Can be wired together by using docker-compose www.sparkbit.pl
  • 4.
    Docker Architecture • Dockercontainer is an application with all of its dependencies • Compared to traditional VM: • No Hypervisor • No Guest OS • Containers are isolated www.sparkbit.pl
  • 5.
    Docker Dictionary • Image– read only snapshot used to build a container • Container – runtime environment built using an image • Dockerfile – recipe on how to create an image • Registry – public or private service for storing images • DockerHub https://hub.docker.com/ - official public registry, like GitHub for docker images www.sparkbit.pl
  • 6.
    Dockerfile • Sample app:https://github.com/tkopczynski/spring-boot-docker • Application should be run by a single command • Application should run on linux • Dockerfile: FROM java:8 # Define base image ADD target/spring-boot-docker.jar spring-boot-docker.jar # Copy application into the image CMD java –jar /spring-boot-docker.jar # Execute application www.sparkbit.pl
  • 7.
    Predefined Images • DockerHuboffers predefined images with many well-known applications • docker run -–name mysql –e MYSQL_ROOT_PASSWORD=root –d –p 3306:3306 mysql • mysql –u root –p –H 127.0.0.1 –P 3306 • docker run –-name solr –d –p 8983:8983 –t solr • http://localhost:8983 • And many, many more... www.sparkbit.pl
  • 8.
    Docker Use Cases •Integration with continuous delivery process • Automatically building images and pushing them to the registry • Standardized environments • Application doesn’t require anything outside of the container so it is always executed in the same environment • Microservices architecture • Manage all microservices as docker images regardless of their technologies and dependencies • Scaling • It is possible to automatically spin up new containers during traffic volume peaks www.sparkbit.pl
  • 9.
    Docker in ContinuousDelivery • After commiting to version control, CI server builds an image with the new version of the application • Container based on that image is tested • If tests pass, it is deployed to test, QA and production environments with the same installation procedure www.sparkbit.pl
  • 10.
    Docker in ContinuousDelivery www.sparkbit.pl
  • 11.
    Docker in TheCloud • Some of the providers: • Amazon EC2 Container Service • Google Container Engine (based on Kubernetes) • Tutum • Docker VM Extension in Azure www.sparkbit.pl
  • 12.
    Summary • Docker isa technology aimed at simplifying DevOps tasks • Build once, ship and run anywhere principle • Lightweight containers • Easily integrated with continuous delivery process and cloud infrastructure www.sparkbit.pl