You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: chapter_09_docker.asciidoc
+31-27Lines changed: 31 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -579,10 +579,13 @@ An image is essentially a pre-prepared root filesystem,
579
579
including the operating system, dependencies, and any code you want to run.
580
580
581
581
Once you have an image, you can run one or many containers that use the same image.
582
+
It's a bit like saying, once you've installed your operating system and software,
583
+
you can start up your computer and run that software any number of times,
584
+
without needing to change anything else.
585
+
586
+
Another way of thinking about it is, images are like classes,
587
+
and containers are like instances.
582
588
583
-
// DAVID: Not sure whether this is going to be understandable in its current form.
584
-
// An analogy that I find helpful here is that images are like classes
585
-
// and containers are like instances.
586
589
587
590
==== A First Cut of a Dockerfile
588
591
@@ -599,13 +602,7 @@ What do we need to do? Something like this, right?
599
602
We create a new file called _Dockerfile_ in the base folder of our repo,
600
603
next to the `src/` directory we made earlier:
601
604
602
-
// DAVID: As discussed, I misread this and put the Dockerfile in src.
603
-
// That led to a difficult to understand error message when I tried to build.
604
-
// ERROR: failed to solve: failed to compute cache key: failed to calculate
605
-
// checksum of ref e126cbb4-3e0c-4e6e-867f-dbfbf5fb190f::k2oys44pcnbefrlpps3ooux7w: "/src": not found
606
-
607
605
// JAN: I'd suggest to use python3.11:slim or python3:12 slim. Keeping image tags too open leads to issues in a couple of months (not always, but waaay too often)
608
-
// JAN: I'd use Docker comments with # for <1>, <2>, ... Otherwise, you need to edit the code when you paste it
0 commit comments