Complete the code to build a Docker image from a Dockerfile.
docker build -t myapp [1] Dockerfile .The -f option specifies the Dockerfile to use when building the image.
Complete the Dockerfile line to add a new file to the image.
COPY [1] /app/The COPY command copies a file from the build context (local folder) to the image. The source is just the filename.
Fix the error in the Dockerfile line that sets the working directory.
WORKDIR [1]appThe WORKDIR path should be an absolute path starting with a slash. Using /app sets the working directory to /app.
Fill both blanks to create a Dockerfile line that runs a command and creates a new image layer.
RUN [1] && [2]
The RUN command executes shell commands and creates a new image layer. Updating package lists and installing curl are common steps.
Fill all three blanks to create a dictionary comprehension that maps image layers to their sizes if size is greater than zero.
layer_sizes = { [1]: [2] for [3], size in layers.items() if size > 0 }This comprehension creates a dictionary with layer names in uppercase as keys and their sizes as values, filtering out layers with size zero.