Loading

Docker101

Raül Martínez i Peris

This is a live streamed presentation. You will automatically follow the presenter and see the slide they're currently on.

Docker

101

What it's?

or...
Does that make?

Docker "enables true independence between applications and infrastructure and developers".

docker engine

image

application

container

Dockerfile

FROM ruby:2.4.2

 

RUN apt-get update
RUN gem install bundler

 

ENV HOME=/home/project
RUN mkdir -p $HOME
ADD . $HOME
WORKDIR $HOME

 

RUN bundle install

Dockerfile

FROM ruby:2.4.2

 

RUN apt-get update
RUN gem install bundler

 

ENV HOME=/home/project
RUN mkdir -p $HOME
ADD . $HOME
WORKDIR $HOME

 

RUN bundle install

image to use

Dockerfile

FROM ruby:2.4.2

 

RUN apt-get update
RUN gem install bundler

 

ENV HOME=/home/project
RUN mkdir -p $HOME
ADD . $HOME
WORKDIR $HOME

 

RUN bundle install

execute a command

Dockerfile

FROM ruby:2.4.2

 

RUN apt-get update
RUN gem install bundler

 

ENV HOME=/home/project
RUN mkdir -p $HOME
ADD . $HOME
WORKDIR $HOME

 

RUN bundle install

set an environment variable

Dockerfile

FROM ruby:2.4.2

 

RUN apt-get update
RUN gem install bundler

 

ENV HOME=/home/project
RUN mkdir -p $HOME
ADD . $HOME
WORKDIR $HOME

 

RUN bundle install

add/copy to guest

Dockerfile

FROM ruby:2.4.2

 

RUN apt-get update
RUN gem install bundler

 

ENV HOME=/home/project
RUN mkdir -p $HOME
ADD . $HOME
WORKDIR $HOME

 

RUN bundle install

set the workdir

docker-compose.yaml

version: '2'
services:
  name_of_service:
     image: name_of_image
     container_name: name_of_container
     build: .
     volumes:
        - .:/home/project
        - bundle:/usr/local/bundle

     command: bash -c "rspec"

 

volumes:

  bundle:
     driver: local

 

Made with Slides.com