\PassOptionsToPackage{dvipsnames}{xcolor}
\documentclass{beamer}

\usetheme{Dresden}
\usecolortheme{whale}

\usepackage{hyperref}
\usepackage[dutch]{babel}
\usepackage{graphicx}
\usepackage{subcaption}

\usepackage{tikz}
\usetikzlibrary{positioning}

\usepackage{minted}

\title{Docker}
\subtitle{\vspace{1cm}\includegraphics[width=.3\linewidth]{moby}}
\author[Camil Staps]{
	Camil Staps\\
	{\footnotesize
		\href{mailto:info@camilstaps.nl}{info@camilstaps.nl}\\
		\href{https://git.camilstaps.nl/LUGN-Docker.git}{https://git.camilstaps.nl/LUGN-Docker.git}
	}
}
\date{11 oktober 2016}

\begin{document}

\pdfinfo{
	/Title (Docker)
	/Author (Camil Staps)
	/Subject (Docker)
	/Keywords (docker, containers, linux)}

\begin{frame}[plain]
	\maketitle
\end{frame}

\begin{frame}
	\frametitle{Inhoudsopgave}
	\tableofcontents
\end{frame}

\section{Introductie}
\begin{frame}
	\frametitle{Wat is Docker}
	\begin{itemize}
		\item Virtualisatie
		\item Lightweight
		\item Secure by default
	\end{itemize}
\end{frame}

\begin{frame}
	\frametitle{Containers vs. Virtual Machines}
	\tikzset{rm/.style={draw=red,text=red}}
	\tikzset{ad/.style={draw=Green,text=Green}}
	\begin{minipage}[b]{.49\linewidth}
		\begin{figure}
			\scriptsize
			\begin{tikzpicture}[
					node distance=2pt,
					every node/.style={rectangle,draw,minimum width=5em}]
				\node                    (app1)  {App 1};
				\node[below=of app1]     (bins1) {Bins/libs};
				\node[rm,below=of bins1] (os1)   {Guest OS};

				\node[right=5pt of app1] (app2)  {App 2};
				\node[below=of app2]     (bins2) {Bins/libs};
				\node[rm,below=of bins2] (os2)   {Guest OS};

				\node[right=5pt of app2] (app3)  {App 3};
				\node[below=of app3]     (bins3) {Bins/libs};
				\node[rm,below=of bins3] (os3)   {Guest OS};

				\node[rm,below=of os2,minimum width=15em+11pt] (hyp) {Hypervisor};
				\node[below=of hyp,minimum width=15em+11pt] (hos) {Host OS};
				\node[below=of hos,minimum width=15em+11pt] (inf) {Infrastructure};
			\end{tikzpicture}
			\caption*{Virtual machines}
		\end{figure}
	\end{minipage}
	\begin{minipage}[b]{.49\linewidth}
		\begin{figure}
			\scriptsize
			\begin{tikzpicture}[node distance=2pt,every node/.style={rectangle,draw,minimum width=5em}]
				\node                    (app1)  {App 1};
				\node[below=of app1]     (bins1) {Bins/libs};

				\node[right=5pt of app1] (app2)  {App 2};
				\node[below=of app2]     (bins2) {Bins/libs};

				\node[right=5pt of app2] (app3)  {App 3};
				\node[below=of app3]     (bins3) {Bins/libs};

				\node[ad,below=of bins2,minimum width=15em+11pt] (eng) {(Docker) engine};
				\node[below=of eng,minimum width=15em+11pt] (hos) {Host OS};
				\node[below=of hos,minimum width=15em+11pt] (inf) {Infrastructure};
			\end{tikzpicture}
			\caption*{Containers}
		\end{figure}
	\end{minipage}
\end{frame}

\section{Dockerfiles}
\begin{frame}[fragile]
	\frametitle{Dockerfiles}
	\inputminted[fontsize=\footnotesize]{docker}{examples/fortune/Dockerfile}
\end{frame}

\begin{frame}[fragile]
	\frametitle{Bouwen}
	\begin{minted}[fontsize=\scriptsize,tabsize=0]{console}
$ docker build -t fortune .
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM debian:jessie
 ---> 1b088884749b
Step 2 : MAINTAINER Camil Staps <info@camilstaps.nl>
 ---> Using cache
 ---> 4311919afa35
Step 3 : RUN apt-get update -qq && apt-get install -qq -y fortune
 ---> Running in 646d62983d27
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package librecode0:amd64.
		# ...
Processing triggers for libc-bin (2.19-18+deb8u4) ...
 ---> 7243ea8162ab
Removing intermediate container 646d62983d27
Step 4 : ENTRYPOINT /usr/games/fortune -s
 ---> Running in 420b0415e53b
 ---> 2d29f9fe8488
Removing intermediate container 420b0415e53b
Successfully built 2d29f9fe8488
	\end{minted}
\end{frame}

\begin{frame}[fragile]
	\frametitle{Runnen}
	\begin{minted}[fontsize=\scriptsize,tabsize=0]{console}
$ docker images
REPOSITORY  TAG     IMAGE ID      CREATED        SIZE
fortune     latest  2d29f9fe8488  5 minutes ago  137.3 MB
<none>      <none>  e466c9f6b26f  6 minutes ago  137.3 MB
<none>      <none>  e3a1930e7832  6 minutes ago  125.1 MB
debian      jessie  1b088884749b  3 months ago   125.1 MB
	\end{minted}
	\pause
	\begin{minted}[fontsize=\scriptsize,tabsize=0]{console}
$ docker run --name fortune_container fortune
Q:      Why was Stonehenge abandoned?
A:      It wasn't IBM compatible.
	\end{minted}
	\pause
	\begin{minted}[fontsize=\scriptsize,tabsize=0]{console}
$ docker start -i fortune_container
Tonight's the night: Sleep in a eucalyptus tree.
	\end{minted}
	\pause
	\begin{minted}[fontsize=\scriptsize,tabsize=0]{console}
$ docker ps --all
CONTAINER ID  IMAGE    CREATED        STATUS      NAMES
4f496eb1518c  fortune  4 minutes ago  Exited (0)  fortune_container
	\end{minted}
\end{frame}

\section{Beveiliging}
\begin{frame}
	\frametitle{Beveiliging}
\end{frame}

\section{Continuous Integration}
\begin{frame}
	\frametitle{Continuous Integration}
\end{frame}

\end{document}
