I'd love to say it was deliberate, but actually it was just by chance.
Each week I'll look at one Dockerfile in detail, showing you what it does and how it works. This is #1 in that series.
Chapter 1 is an introductory chapter. The Dockerfile for dockeronwindows/ch01-whale just builds an image you can use to test that your Docker setup is working correctly.
Assuming you have Docker installed (e.g. with Docker for Windows), run a container like this:
docker container run dockeronwindows/ch01-whale
And the output is an ASCII art picture of a whale, adpated from the official whalesay image:
There's not much to this Dockerfile, just three lines:
FROM microsoft/nanoserver COPY ascii-whale.txt . CMD ["powershell", "cat", "ascii-whale.txt"]
1 - use the latest version of Microsoft's Nano Server Docker image as the base. The application in this case is just some PowerShell, so it can use the minimal OS rather than full Windows Server Core.
2 - copy the text file from the host (where the
docker image build command runs), into the Docker image. I specify
. as the target destination, which will put the file in the current working directory for the image.
3 - when a container is run from the image, execute the command
cat ascii-whale.txt using PowerShell. When the container runs it will use the same working directory, so the text file is in the current path.