Fireship · @fireship
Docker in 100 Seconds
Uploaded August 17, 2020 · Length 2:07
Summary
docker packaging software into containers for reliable deployment across environments.
- docker
- containerization
- virtualization
- devops
- software deployment
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
docker a tool that can package software
- 0:02
into containers that run reliably in any
- 0:04
environment but what is a container and
- 0:06
why do you need one let's imagine you
- 0:07
built an app with cobalt that runs on
- 0:09
some weird flavor of linux you want to
- 0:11
share this app with your friend but he
- 0:12
has an entirely different system so the
- 0:14
problem becomes how do we replicate the
- 0:15
environment our software needs on any
- 0:17
machine one way to package an app is
- 0:19
with a virtual machine where the
- 0:20
hardware is simulated then installed
- 0:22
with the required os and dependencies
- 0:24
this allows us to run multiple apps on
- 0:25
the same infrastructure however because
- 0:27
each vm
- 0:28
is running its own operating system they
- 0:30
tend to be bulky and slow
- 0:32
now a docker container is conceptually
- 0:34
very similar to a vm
- 0:35
with one key difference instead of
- 0:36
virtualizing hardware containers only
- 0:38
virtualize the os
- 0:40
or in other words all apps or containers
- 0:42
are run by a single kernel
- 0:44
and this makes almost everything faster
- 0:45
and more efficient there are three
- 0:47
fundamental elements in the universe of
- 0:49
docker
- 0:49
the docker file the image and the
- 0:51
container the docker file is like dna
- 0:54
it's just code that tells docker how to
- 0:56
build an image which itself is a
- 0:58
snapshot of your software
- 1:00
along with all of its dependencies down
- 1:01
to the operating system level the image
- 1:03
is immutable and it can be used to spin
- 1:05
up multiple containers which is your
- 1:07
actual software running in the real
- 1:08
world
- 1:09
create a docker file and use from to
- 1:11
start from an existing template like
- 1:13
ubuntu this base image gets pulled down
- 1:15
from the cloud
- 1:15
and you can also upload your own images
- 1:17
to a variety of different docker
- 1:19
registries
- 1:19
from there you might want to use run to
- 1:21
run a terminal command that installs
- 1:23
dependencies into your image
- 1:24
you can set environment variables and do
- 1:26
all kinds of other stuff then the last
- 1:27
thing you'll do is set a default command
- 1:29
that's executed when you start up a
- 1:30
container
- 1:31
and now we can create the image file by
- 1:33
running the docker build command
- 1:34
it goes through each step in our docker
- 1:36
file to build the image layer by layer
- 1:38
we can then bring this image to life as
- 1:40
a container with the docker run command
- 1:42
as your app demands more resources you
- 1:44
can run it on multiple machines multiple
- 1:46
clouds on-prem
- 1:47
or wherever you want reliably this has
- 1:49
been docker in 100 seconds
- 1:51
if you enjoyed it make sure to like and
- 1:52
subscribe and stay tuned for more docker
- 1:54
content coming to this channel soon
- 1:56
thanks for watching and i will see you
- 1:58
in the next one


