docker compose

Post on 15-Aug-2015

85 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

DOCKER COMPOSEFelipe Ruhland @ Python Floripa

DOCKERABOUT

ABOUTDOCKER

written in golang

ABOUTDOCKER

open-source project

DOCKER

developers and sysadmins

ABOUT

DOCKER

develop, ship, and run

ABOUT

DOCKER

production as fast as possible

ABOUT

history

Solomon Hykes history

history

history

maincontributors

JAN

$15 million(Venture Capital)

JUL

Docker acquiredOrchard (Fig)

2014

SEP

$40 million

(Sequoia Capital)

OCT

Microsoft announced integration (2016)

DOCKERWHY

LIGHTWEIGHTOPEN

SECURE

- Faster delivery of your applications

- Deploy and scale more easily

- Get higher density and run more workloads

- Faster deployment makes for easier management

WHY DOCKER

CONTAINERVM vs

CONTAINERVM

WORKSHOW IT

HOW IT WORKS

- libcontainer (libvirt, LXC, systemd-nspawn)

- cgroups

- namespaces

- images distribution

COMPOSEDOCKER

DOCKER COMPOSE

- Tool for defining and running multi-container applications

- Single file configuration

- Great for development environments, staging servers, and CI

- Written in python

- We don’t recommend that you use it in production yet.

DOCKER COMPOSE

- Binding to different ports on the host

- Setting environment variables differently

- Specifying a restart policy

- Adding extra services

BUT

!

#1define environment with Dockerfile

#2define serviceswith docker-compose.yml

#3docker-compose up

dockerfileFROM python:2.7

ADD . /code

WORKDIR /code

RUN pip install -r requirements.txt

CMD python app.py

docker-compose.ymlweb:

build: .

ports:

- "5000:5000"

volumes:

- .:/code

links:

- redis

redis:

image: redis

docker-compose up$ docker-compose up

Pulling image redis...

Building web...

Starting composetest_redis_1...

Starting composetest_web_1...

redis_1 | [8] 02 Jan 18:43:35.576 # Server started, Redis version 2.8.3

web_1 | * Running on http://0.0.0.0:5000/

docker compose cli

commandsbuild

logs

run

scale

up

github.com/feliperuhland

feliperuhland.com

@feliperuhland

THANK YOU

top related