42
DOCKER - WHAT’S THE MATTER? MICHAL SZCZUR

Docker what's the matter

Embed Size (px)

Citation preview

DOCKER - WHAT’S THE MATTER?

MICHAL SZCZUR

MICHAŁ SZCZUR

SOFTWARE DEVELOPER AT PGS SOFTWARE BASS GUITARIST, TRUMPETER, FOLK MUSIC ARTIST

@PARTIKUS

AGENDA

▸ Docker - what is it and how it works?

▸ Docker vs Vagrant

▸ How to use Docker at work?

▸ Some examples and stories

WHAT IS DOCKER?

WHY SHOULD I USE DOCKER?

WHAT PROBLEMS DOCKER SOLVES?

▸ „it works on my machine”

▸ Reduce build & deploy time

▸ No more configuration spaghetti - organized configuration

▸ Libs dependency hell

▸ Packed into containers

DOCKER IS A PLATFORM FOR DEVELOPERS AND SYSADMINS TO DEVELOP, SHIP, AND RUN APPLICATIONS.

docs.docker.com

Symfony

Docker

CONCEPTSDOCKER

DOCKER CONCEPTS

CONCEPTS

▸ Images

▸ read only

▸ Dockerfile

▸ like a makefile

▸ commands order and cache’ing

▸ extendable

▸ as a result new image given

▸ Containers - instances of running apps

DOCKER TOOLS

TOOLS

DOCKER SOLUTIONS

▸ DOCKER HUB

▸ DOCKER TRUSTED REGISTRY

▸ TUTUM

▸ DOCKER UNIVERSAL CONTROL PLANE (BETA)

TOOLS

DOCKER TOOLBOX

▸ Docker Machine

▸ Docker Swarm

▸ Docker Compose

▸ Docker Registry

▸ Docker Engine

▸ Kitematic

SEMANTICSDOCKER REGISTRY

SEMANTIC LIKE GIT

▸ commit

▸ pull

▸ push

▸ images

▸ …

BENEFITS

BENEFITS

▸ Movable - Java’s promise

▸ Lightweight

▸ Independence

DOCKER VS VAGRANT

CREATE AND CONFIGURE LIGHTWEIGHT, REPRODUCIBLE, AND PORTABLE DEVELOPMENT ENVIRONMENTS.

vagrantup.com

DOCKER VS VAGRANT VIRTUAL MACHINE

VAGRANT == DOCKER-COMPOSE

HOW TO USE DOCKER AT WORK?

LOCAL DEV ENVDOCKER FOR DEVELOPMENT

TESTINGCONTINUOUS INTEGRATION

TESTING

CONTINUOUS INTEGRATION

▸ run tests per every commit

▸ don’t worry about cleaning up

▸ running parallel tests

CONTINUOUS DELIVERY

AUTOMATED DEPLOYMENT

DOCKER IN PAAS MODEL

PAAS

PAAS

▸ DOKKU

▸ DEIS

▸ FLYNN.IO

EXAMPLES

DOCKERFILEDOCKER

FROM php:5.6-cli

MAINTAINER [email protected]

RUN docker-php-ext-install iconv intl mysqli mysql gd mbstring pdo_mysql xsl opcache

RUN curl -sS https://getcomposer.org/installer | php && \

mv composer.phar /usr/local/bin/composer && \

chmod +x /usr/local/bin/composer

EXPOSE 8080

COPY php.ini /usr/local/etc/php

ADD entrypoint.sh /entrypoint.sh

VOLUME /var/www

WORKDIR /var/www

ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]

#!/bin/bash # ENTRYPOINT

composer install --no-interaction --no-progress

php -S 0.0.0.0:8080 -t web

DOCKER-COMPOSEDOCKER

hub:

image: selenium/hub

ports:

- "4444:4444"

environment:

- GRID_TIMEOUT=30000

firefox:

image: selenium/node-firefox

links:

- hub

chrome:

image: selenium/node-chrome

links:

- hub

docker-compose up -d

docker-compose scale chrome=5 firefox=5

QUESTIONS?

THANKS

LINKS

▸ http://michalszczur.pl

▸ http://docs.docker.com

▸ http://vagrantup.com

▸ http://bit.ly/1IENdHh

▸ https://www.heroku.com/

▸ http://progrium.viewdocs.io/dokku/