learning docker from square one

Post on 21-Jan-2018

765 Views

Category:

Technology

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Learning Docker From Square One

Developer Evangelist, Codefresh

Chloe Condon

@chloecondon

I’m Whaley Glad You’re Here! 🐳

Me at my last DockerCon!

Our Docker journey begins…

Hi, I’m Chloe!

Now a Developer Evangelist(Woo! Thanks Docker! 🎉 )

Let’s Start From the Very Beginning

“A very good place to start…”

@chloecondon

Images & Containers• Layers• DockerHub• Official Images• Tagging/Pushing• Dockerfiles

I’ll Show You A Thing Or Two About…Volumes• Persistant data• Bind MountingDocker Compose• yaml files• Compose commands• Building images

@chloecondon

Demo Time!

Images & Containers

What’s the difference? 🤔

@chloecondon

Let’s Break it Down…

An image is an application you’d like to run

A container is a running instance of an image

@chloecondon

Let’s Break it Down…

An image is an application you’d like to run

A container is a running instance of an image

@chloecondon

@chloecondon

Think of it this way…

Image = DVD 💽

Container = DVD Player 📺

@chloecondon

Think of it this way…

Docker Image = The basis of a Docker container. Represents a full application.

Container = The standard unit in which the application service resides and executes.

@chloecondon

@chloecondon

@chloecondon

@chloecondon

So, a container is a lightweight VM, right?

@chloecondon

So, a container is a lightweight VM, right?

Think of VMs like a 🏡…

…and containers like an 🏢…

…stay with me here!

@chloecondon

So, a container is a lightweight VM, right?

@chloecondon

So, a container is a lightweight VM, right?

@chloecondon

Let’s Review!

@chloecondon

So, a container is a lightweight VM, right?

“Docker is not a virtualization technology, it’s an application delivery technology” -Mike Coleman

@chloecondon

Layers

@chloecondon

Layers

@chloecondon

Layers

@chloecondon

Layers

@chloecondon

Layers

@chloecondon

Layers

@chloecondon

DockerHub

@chloecondon

Tags

@chloecondon

Enter Tags!

@chloecondon

Tags

@chloecondon

Tags

@chloecondon

Tags

@chloecondon

Tags… what’s in a name? -Shakespeare… jk

@chloecondon

Push it!

@chloecondon

Push it!

@chloecondon

Push it!

@chloecondon

Dockerfiles are……instructions…

…that you need to optimize!

@chloecondon

Things to consider with DockerfilesEphemeral

( unnecessary packages

1 container = 1 concern

Minimal layers

@chloecondon

@chloecondon

@chloecondon

@chloecondon

@chloecondon

@chloecondon

@chloecondon

@chloecondon

Volumes

@chloecondon

Volumes

Data volumes are designed to persist data, independent of the container’s lifecycle.

@chloecondon

VOLUME [“/data”]

Volumes

@chloecondon

• Host Volumesdocker run -v /path/on/host:/path/in/container ...

• Anonymous Volumesdocker run -v /path/in/container ...

• Named Volumesdocker volume create somevolumename docker run -v name:/path/in/container ...

Volumes

@chloecondon

Volumes

@chloecondon

Docker Compose1. Define with a Dockerfile2. Write a docker-compose.yml3. Run docker-compose up

@chloecondon

Demo Time!

Great Resources!• Play with Docker )• Bret Fisher’s class on Udemy *• Docker Docs 🐳• Anything from a Docker Captain! 🚢 (docker.com/captains)• Codefresh 🍃

@chloecondon

Thank You!@chloecondon on most things!

My articles on Medium cover:• Docker Basics• Volumes• Tags• & much more!

Come to my Hallway Track after this!Otherwise, I’ll be chilling in the foam pit!

top related