Fireship · @fireship

Docker in 100 Seconds

Uploaded August 17, 2020 · Length 2:07

Docker in 100 Seconds

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.

  1. 0:00

    docker a tool that can package software

  2. 0:02

    into containers that run reliably in any

  3. 0:04

    environment but what is a container and

  4. 0:06

    why do you need one let's imagine you

  5. 0:07

    built an app with cobalt that runs on

  6. 0:09

    some weird flavor of linux you want to

  7. 0:11

    share this app with your friend but he

  8. 0:12

    has an entirely different system so the

  9. 0:14

    problem becomes how do we replicate the

  10. 0:15

    environment our software needs on any

  11. 0:17

    machine one way to package an app is

  12. 0:19

    with a virtual machine where the

  13. 0:20

    hardware is simulated then installed

  14. 0:22

    with the required os and dependencies

  15. 0:24

    this allows us to run multiple apps on

  16. 0:25

    the same infrastructure however because

  17. 0:27

    each vm

  18. 0:28

    is running its own operating system they

  19. 0:30

    tend to be bulky and slow

  20. 0:32

    now a docker container is conceptually

  21. 0:34

    very similar to a vm

  22. 0:35

    with one key difference instead of

  23. 0:36

    virtualizing hardware containers only

  24. 0:38

    virtualize the os

  25. 0:40

    or in other words all apps or containers

  26. 0:42

    are run by a single kernel

  27. 0:44

    and this makes almost everything faster

  28. 0:45

    and more efficient there are three

  29. 0:47

    fundamental elements in the universe of

  30. 0:49

    docker

  31. 0:49

    the docker file the image and the

  32. 0:51

    container the docker file is like dna

  33. 0:54

    it's just code that tells docker how to

  34. 0:56

    build an image which itself is a

  35. 0:58

    snapshot of your software

  36. 1:00

    along with all of its dependencies down

  37. 1:01

    to the operating system level the image

  38. 1:03

    is immutable and it can be used to spin

  39. 1:05

    up multiple containers which is your

  40. 1:07

    actual software running in the real

  41. 1:08

    world

  42. 1:09

    create a docker file and use from to

  43. 1:11

    start from an existing template like

  44. 1:13

    ubuntu this base image gets pulled down

  45. 1:15

    from the cloud

  46. 1:15

    and you can also upload your own images

  47. 1:17

    to a variety of different docker

  48. 1:19

    registries

  49. 1:19

    from there you might want to use run to

  50. 1:21

    run a terminal command that installs

  51. 1:23

    dependencies into your image

  52. 1:24

    you can set environment variables and do

  53. 1:26

    all kinds of other stuff then the last

  54. 1:27

    thing you'll do is set a default command

  55. 1:29

    that's executed when you start up a

  56. 1:30

    container

  57. 1:31

    and now we can create the image file by

  58. 1:33

    running the docker build command

  59. 1:34

    it goes through each step in our docker

  60. 1:36

    file to build the image layer by layer

  61. 1:38

    we can then bring this image to life as

  62. 1:40

    a container with the docker run command

  63. 1:42

    as your app demands more resources you

  64. 1:44

    can run it on multiple machines multiple

  65. 1:46

    clouds on-prem

  66. 1:47

    or wherever you want reliably this has

  67. 1:49

    been docker in 100 seconds

  68. 1:51

    if you enjoyed it make sure to like and

  69. 1:52

    subscribe and stay tuned for more docker

  70. 1:54

    content coming to this channel soon

  71. 1:56

    thanks for watching and i will see you

  72. 1:58

    in the next one