Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DockerCon 2019 - Containers for Beginners

DockerCon 2019 - Containers for Beginners

Feeling overwhelmed while getting started with containers? Have you been tasked to figure out how to train everyone back at your organization? There's just so much to learn and teach! In this talk, we’ll start with a tiny bit of history to motivate the "why" and quickly move into the "what" by explaining what container and images actually are (they're not just magical black boxes!). We'll talk about how volumes help with data persistence and include an overview of Docker Compose and even orchestration. There will be plenty of live demos and fun!

https://www.youtube.com/watch?v=6gJs0F8V3tM

Michael Irwin

April 30, 2019
Tweet

More Decks by Michael Irwin

Other Decks in Technology

Transcript

  1. @mikesir87 Welcome! Glad to have you on the team! Clone

    the repo, use the wiki for setup instructions, and update the docs as needed. Good luck!
  2. @mikesir87 Creating Images Dockerfile docker build FROM node WORKDIR /app

    COPY package.json yarn.lock . RUN yarn install COPY src ./src CMD ["node", "src/index.js"]
  3. @mikesir87 Containers vs VMs Infrastructure Host Operating System Hypervisor Guest

    OS Bins/Libs App 1 Guest OS Bins/Libs App 2 Guest OS Bins/Libs App 3 Infrastructure Operating System Bins/Libs App 1 Bins/Libs App 2 Bins/Libs App 3 Docker Daemon
  4. @mikesir87 Layer contents file1 file2 file3 file4 file2 file5 file1

    file2 file3 file4 file5 Layer 1 Layer 2 Merged
  5. @mikesir87 What about deleted files? • • file1 file2 file3

    file4 file2 file5 file1 file2 file3 file5 Layer 1 Layer 2 Merged .wh.file4 Layer 3
  6. @mikesir87 Clean up as you go! • • RUN FROM

    ubuntu RUN apt-get update RUN apt-get install -y python python-pip RUN pip install awscli RUN apt-get autoremove --purge -y python-pip FROM ubuntu RUN apt-get update && \ apt-get install -y python python-pip && \ pip install awscli && \ apt-get autoremove --purge -y python-pip && \ rm -rf /var/lib/apt/lists/*
  7. @mikesir87 Keep images tight and focused FROM node AS build

    WORKDIR /usr/src/app COPY package.json yarn.lock . RUN yarn install COPY public ./public COPY src ./src RUN yarn build FROM nginx:alpine COPY nginx.conf /etc/nginx/nginx.conf COPY --from=build /usr/src/app/build /usr/share/nginx/html
  8. @mikesir87 • • ◦ ◦ -v $HOME/mysql-data:/var/lib/mysql • ◦ ◦

    docker volume inspect ◦ -v mysql-data:/var/lib/mysql Volumes