6 ms·
> Second, the Docker Engine which takes a Dockerfile and runs it on a Linux host natively, without a virtual machine. This is a grand oversimplification/miscon
by whirlwin 3y ago
> Second, the Docker Engine which takes a Dockerfile and runs it on a Linux host natively, without a virtual machine.
This is a grand oversimplification/misconception.
The Dockerfile is just a description on how to build a container image. Running a container on an engine is a different story.
- wlonkly 3y agoI'm not even sure if it's an oversimplification or misconception. I think it might just be a plain old error, and the author meant to write "takes a Docker image".
- krick 3y agoHonestly, it doesn't seem to me that the author knows what he is is talking about anyway.
- krick 3y agoI mean, that post is a grand oversimplification to the point of being basically wrong on so many levels, that I'm not even sure why do you pick specifically that point to argue about. Even though you are totally right.
- moolcool 3y agoI think it's pedantic to call it a "grand oversimplification". It seems like a reasonable simplification to me. Like calling a .py file an application is reasonable IMO, even though it's a simplification because it's "just" instructions for an interpreter.
- baobabKoodaa 3y ago> It seems like a reasonable simplification to me. It's not reasonable at all. If someone is trying to learn Docker and they read this misleading article, they will think they can somehow run their Dockerfile as a container, and they will be wholly confused as to why it's not going to work out.
- moolcool 3y agoOr they'll see that it's a small human-readable text file and not several hundred megabytes of machine code and come to a reasonable conclusion. If I give you a cookie recipe and say "These are the best cookies", it's self-evident that I don't want you to eat the paper.
- paulddraper 3y agoNot really. I create my docker images with Bazel/crane [1]. (For reproducibility.) There are no Dockerfiles at all. --- The .py example is bad because there is nothing else (AFAIK) that produces .pyc. [1] https://github.com/bazel-contrib/rules_oci https://github.com/bazel-contrib/rules_oci
- moolcool 3y agoNobody who is just learning docker knows or cares what Bazel or Crane are. A pedant might similarly go the other way and say "C isn't just a compiled language, because personally I use the Ch C interpreter". I don't think it's a good enough reason to avoid reasonable simplifications in technical writing because "Well actually, advanced users have an edge case where that assumption doesn't strictly hold....". The only way for anyone to get a reasonable understanding of anything complex is by starting with small simplifications and generalizations.
- paulddraper 3y agoYes, but that doesn't change the fact that Docker Engine doesn't run Dockerfiles. Even for a beginner, that's unhelpful. They're going to expect docker run Dockerfile
- whirlwin 3y agoOf course you can run a .py file a program. But would you say the same regarding e.g. a C source file? It has to be compiled first, just as a Dockerfile has to build a container image which in turn can be run.
- vorpalhex 3y agoThe article is correct if simple. Running a container is not very hard in the linux case since it is just a new cgroup entry. Obviously there is an extra layer in the case of Mac/Windows but you're still just setting up cgroups.
- baobabKoodaa 3y ago> The article is correct if simple. The article is incorrect. If you don't download or build the Docker image from the Dockerfile, you will not be able to run a container from the Dockerfile alone.
- ylyn 3y agocgroups aren't even the main thing. The main thing is the mount namespace.
- hn_throwaway_99 3y agoI don't find it to be an oversimplification at all. If I say "the terminal takes this bash script and runs it", I understand the bash script may do a ton of complicated things, and all the system services that are set up in the first place to run bash are complicated, but I see nothing wrong or oversimplified about that sentence.
- whirlwin 3y agoIt's not the same comparison. You can perfectly well run a shell script in the terminal. But you cannot run a Dockerfile, in the same way you cannot run a C++ source file as an executable. It needs to be compiled first.
- crabbone 3y agoWell, actually... you can just run C++ source as an executable... there are a bunch of C++ interpreters out there (of various quality, and probably not quite useful, but hey, nobody said you will have a good time running your C++ source). But, yeah, if the article wanted to clarify instead of obscuring the functionality of Docker, the one we know and use, then saying that it runs the Dockerfile is misleading. I mean, it does run it to builds an image, that's how it build the image, but then readers need an explanation for why there are images and why do they need them, if all they do is running Dockerfiles, and that's where the "explanation" becomes worthless.