A very basic example of a Dockerfile might look something like this:
# escape=`
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
WORKDIR C:\inetpub\wwwroot
COPY .\testfile.txt .\
Line by line, it does the following:
- The
escape
directive sets the character used to escape characters in aDockerfile
. If not specified, the default escape character is\
. - Specifies that the Dockerfile allows an argument called 'BASE_IMAGE'
- Specifies that we use the provided argument BASE_IMAGE as the base layer for the new image.
- Sets the working directory to “
C:\inetpub\wwwroot
“ - Copies the file testfile.txt from the root of the supplied ‘Context' to the root of the 'Working Directory’.
If this file is then built, the resulting image would be saved (with no name) to the local docker image store.
Build an image from this Dockerfile
For more information on how you would build this Dockerfile and create a new image, see this page Docker Build Command