Introducción a Docker 

@yograterol

  • Backend Developer
  • DevOps
  • Platzi
  • Contribuidor en Fedora
  • MongoEngine

Yohan Graterol

  • Que es Docker?
  • Instalación
  • Registry
  • Demo

Agenda

  • Proyecto open source creado por Solomon Hykes para dotCloud (PaaS).
  • Despliegue de aplicaciones en contenedores.
  • Virtualización a nivel de sistema.
  • LXC al inicio luego libcontainer.
  • Escrito en Go Lang.

Docker

Docker

Imagenes

  • Capa de solo lectura.
  • Contiene librerias/binarios.

Imagenes

Imagenes

Contenedores

Contenedores

Contenedores

Contenedores

Contenedores

Dockerfile

FROM fedora
MAINTAINER scollier <scollier@redhat.com>

RUN yum -y update && yum clean all
RUN yum -y install openssh-server passwd && yum clean all
ADD ./start.sh /start.sh
RUN mkdir /var/run/sshd

RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N '' 

RUN chmod 755 /start.sh
# EXPOSE 22
RUN ./start.sh
ENTRYPOINT ["/usr/sbin/sshd", "-D"]

Instalación

Instalación en Fedora

$ sudo yum -y install docker

# Inicia el daemon

$ sudo systemctl start docker

# Si desea arrancar docker al inicio

$ sudo systemctl enable docker

Instalación en Ubuntu

# Requiere version > 3.13 del kernel y wget.

$ sudo apt-get update

$ wget -qO- https://get.docker.com/ | sh

Instalación en ArchLinux

$ sudo pacman -S docker

# Inicio de Docker similar a Fedora.

$ sudo systemctl start docker

Boot2Docker

https://github.com/boot2docker/windows-installer/releases/latest

https://kitematic.com/ (Para Mac)

Kitematic

Registry

Docker Registry

  • Control de versiones de imágenes de Docker (push & pull)
  • Open Source.
  • Imágenes publicas/privadas y construcciones seguras.

Docker Registry

Demo

Introduccion a Docker - Platzi 2015

By Yohan Graterol

Introduccion a Docker - Platzi 2015

  • 1,233