Answers to each bulleted question, in corresponding order:
- Yes, the image is
dockerinaction/hello_world
.
- Yes, the image does reference
busybox:latest
, and builds upon it.
- No, the Dockerfile is not stored on your machine. The
docker run
command is downloading a compressed version of the built Docker image that it found on Docker Hub. In some ways, you can think of the Dockerfile as the source code and the built image as the binary.
If you wanted to, you could write your own Dockerfile with the following contents:
FROM busybox:latest
CMD ["echo", "hello world"]
Then, in the directory containing that file (named Dockerfile
), you could:
$ docker build -t my-hello-world:latest .
$ docker run my-hello-world:latest
The docker build
command builds the Dockerfile, which in this case is stored on your machine. The built Docker image is tagged as my-hello-world:latest
, and is only available on your machine (where it was built) unless you push
it somewhere. You can run the built image from your machine by referring to the tag in the docker run
command, as in the second line above.