Workshop 1

April 7, 2018

Use code DOHACKSOC15 for $15 of free credit when you create your account.

Docker​
Getting Started

Your First Image

Docker is a container engine

A container image is a lightweight, stand-alone, executable package of a piece of software that includes everything needed to run it

docker.com

Single Piece of Software

  • One Service
  • One Purpose
  • Improves Scalability

Lightweight

  • Kernal not included
  • Images are made up of "steps"
  • Only what you need

Use Cases

and

Examples

Use Cases

Can you think of any?

Scaling

USA

EU

AU

01:00 GMT

19:00 GMT

08:00 GMT

CDN

PROCCESSING

AUTH

GUI

DATABASE

Predictable Development Environment

Docker​
Getting Started

Your First Image

FROM node:latest

ENV NPM_SCRIPT=start

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY package.json /usr/src/app/
RUN npm install

COPY .env /usr/src/app

COPY . /usr/src/app

EXPOSE 80

CMD npm ${NPM_SCRIPT}
FROM node:latest
ENV NPM_SCRIPT=start
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY .  /usr/src/app
EXPOSE 80
CMD run ${CMD}
$ docker run 
hacksoc/hello-world
$ docker run 
hacksoc/hello-world
Unable to find image 'hacksoc/hello-world:latest' locally

latest: Pulling from hacksoc/hello-world

# scratch
ff3a5c916c92: Already exists

# alpine:latest
627bdaa1140e: Pull complete

# hacksoc/hello-world:latest
Digest: sha256:a2900d9fb318e5fff31fd97bae1caaa03a953e2bbc84694f13542f9eecdfe1a7

Status: Downloaded newer image for hacksoc/hello-world:latest

Questions?

Docker
Getting Started

Your First Image

$ git clone
https://github.com/aaronosher/DockerWorkshop
$ git checkout Workshop-1
$ cd DockerWorkshop
Made with Slides.com