deis_docker



deis_docker

0 0


deis_docker


On Github philippwiendl / deis_docker

DEIS

Your PaaS. Your Rules.

Docker

Build, Ship, Run

Philipp Wiendl, @hotelquickly

DEIS

  • CoreOS
  • Ceph
  • Docker, Docker Registry
  • Git, Logspout, PostgreSQL

CoreOS

  • minimal Linux distribution
  • kernel - 4.x
  • docker
  • etcd - consistent key-value store
  • fleet - distributed init system

Ceph

  • distributed object store
  • object-, block- anf file-level storage
  • scalable to the exabyte (1 billion gigabytes)
  • replicates data
  • fault-tolerant
  • self-healing and self-managing

Deploy

  • follow twelve-factor methodology
  • Heroku Buildpacks
  • Dockerfiles
  • Docker Images

Buildpacks

Ruby | Node.js | Clojure | Python

Java | Gradle | Grails | Scala

Play | PHP | Go

web: bundle exec ruby web.rb -p ${PORT:-5000}
web: node server.js
web: vendor/bin/heroku-php-nginx -C nginx_app.conf web/
location / {
    try_files $uri @rewriteapp;
}

location @rewriteapp {
    rewrite ^(.*)$ /index.php/$1 last;
}

future

  • kubernetes
  • mesos
  • swarm
  • addons

Docker

  • container virtualization
  • sharing operating system kernel
  • isolated process in userspace
  • btfrs - copy on write filesystem
FROM debian:jessie
MAINTAINER NGINX Docker Maintainers "docker-maint@nginx.com"
RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62
RUN echo "deb http://nginx.org/packages/mainline/debian/ jessie nginx" >> /etc/apt/sources.list
ENV NGINX_VERSION 1.9.4-1~jessie

RUN apt-get update && \
    apt-get install -y ca-certificates nginx=${NGINX_VERSION} && \
    rm -rf /var/lib/apt/lists/*

RUN ln -sf /dev/stdout /var/log/nginx/access.log
RUN ln -sf /dev/stderr /var/log/nginx/error.log

VOLUME ["/var/cache/nginx"]
EXPOSE 80 443
CMD ["nginx", "-g", "daemon off;"]
FROM alpine:3.2
RUN apk add --update-cache curl bash sudo && rm -rf /var/cache/apk/*
ADD build.sh /tmp/build.sh
WORKDIR /tmp
RUN mkdir -p /opt/nginx && DOCKER_BUILD=true /tmp/build.sh
RUN tar -C /opt/nginx -czf /nginx.tgz .
REPOSITORY                               VIRTUAL SIZE
docker.io/alpine                         5.25 MB
docker.io/debian                         125.1 MB
docker.io/nginx                          132.8 MB
docker.io/hotelquickly/nginx             496 MB
-rw-r--r--    1 root     root        3.4M Sep 21 07:01 nginx.tgz
FROM alpine:3.2

ENV DEBIAN_FRONTEND noninteractive

RUN addgroup -S nginx && \
  adduser -S -G nginx -H -h /app/errors -s /sbin/nologin -D nginx

WORKDIR /app

ADD nginx.tgz /opt/nginx

EXPOSE 80 443 1443
CMD ["/usr/bin/supervisord"]
REPOSITORY                               VIRTUAL SIZE
my_nginx                                 13.52 MB
DEIS Your PaaS. Your Rules. Docker Build, Ship, Run Philipp Wiendl, @hotelquickly