fast, isolated development environments using docker€¦ · docker history january 2013 docker...

23
Fast, isolated development environments using Docker Andreas Nanko Senior Solution Architect Continum AG [email protected] https://github.com/andreasnanko

Upload: others

Post on 26-Jul-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to

Fast, isolated development environments using Docker

Andreas Nanko Senior Solution Architect Continum AG

[email protected] https://github.com/andreasnanko

Page 2: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to

Challenges

Page 3: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to
Page 4: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to

Present-day solutions

Page 5: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to
Page 6: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to

Survey

Who have heard of Docker? Who have tried Docker ?

Who is using Docker for his work ?

Page 7: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to

Docker historyJanuary 2013

Docker started as an internal project inside of dotCloud

March 2013 Docker 0.1 released to public

September 2013 Docker merged into Openstack

October 2014 Microsoft announced integration of the Docker engine into the next Server release

August 2015 Docker released Docker Engine 1.8.0, Docker Compose 1.4.0, Docker Swarm and Docker Machine 0.4.0

Page 8: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to

About Docker

„Docker is an open-source engine to easily create lightweight, portable, self-sufficient containers from any

application“

Lightweight Open Source Secure Written in GO

Page 9: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to

How does Docker work ?

Docker

Linux

libcontainer

libvirt lxc systemd-nspawn

cgroups namespaces netlink selinux netfilter capabilities apparmor

Page 10: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to

Control Groups & NamespacesLinux kernel features to limit,

account and isolate resources

Cpu Memory Disk i/o Network

Page 11: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to

„chroot on steroids“

Page 12: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to

Why containers ?

Speed: Boots in seconds Footprint: Hundreds of containers on one machine Exchange: Containers can be shared easily

Page 13: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to

Docker requirements

Linux Kernel 3.10 or above iptables 1.4 or later

git 1.7 or later 64-bit OS

Page 14: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to

Installing Docker

Page 15: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to

$> curl -sSL https://get.docker.com/ | sh

Page 16: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to

Basic commandsGet base image $> docker pull ubuntu

List images on your system $> docker images

Get containers $> docker ps

Remove container $> docker rm <containerid>

Remove image $> docker rmi <imageid>

Stop container $> docker stop <containerid>

Start container $> docker run -d -p \ 1022:22 -p 1080:80 <imageid>

Exec bash in running container docker exec -it <containerid> bash

Page 17: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to

Creating Docker images: the interactive wayStart container based on ubuntu image $> docker run -i -t ubuntu /bin/bash root@23c34ee50ce:/# root@23c34ee50ce:/# apt-get update root@23c34ee50ce:/# apt-get install nginx root@23c34ee50ce:/# exit

Commit the created image $> docker commit `docker ps -q -l` opstack:nginx

Start the newly created image $> docker run -d -p 80:80 --name <containername> opstack:nginx

Page 18: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to

Creating Docker images: the scripted wayCreate Dockerfile # Nginx FROM ubuntu:14.04 MAINTAINER Andreas Nanko <[email protected]>

RUN apt-get update RUN apt-get install -y nginx

Build the image docker build -t opstack:nginx .

Start the image $> docker run -d -p 80:80 --name <containername> opstack:nginx

Page 19: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to

How does this help?

Page 20: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to
Page 21: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to

Oxid Setup in less than 5 minutes

Page 22: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to

Whats next ?

Page 23: Fast, isolated development environments using Docker€¦ · Docker history January 2013 Docker started as an internal project inside of dotCloud March 2013 Docker 0.1 released to

More information on

https://docs.docker.com/ https://github.com/andreasnanko/OxidCE-dockerized

Andreas Nanko Senior Solution Architect Continum AG

[email protected] https://github.com/andreasnanko