Complete the code to specify the base image in a Dockerfile.
FROM [1]The FROM instruction sets the base image for the Docker container. Here, ubuntu:latest is a valid base image.
Complete the code to expose port 80 in the Dockerfile.
EXPOSE [1]The EXPOSE instruction tells Docker which port the container listens on. Port 80 is the standard HTTP port.
Fix the error in the Dockerfile command to run the app.
CMD ["python", "[1]"]
The CMD runs the main application. Here, app.py is the correct script to start.
Fill both blanks to create a volume mount and set environment variable in docker run command.
docker run -v [1] -e [2]=production myapp
The -v option mounts the host directory /host/data to container's /data. The -e sets environment variable ENV to 'production'.
Fill all three blanks to write a Dockerfile snippet that copies files, installs dependencies, and runs the app.
COPY [1] /app RUN pip install [2] CMD ["python", "[3]"]
COPY . /app copies current folder to /app in container. RUN pip install -r requirements.txt installs dependencies. CMD ["python", "app.py"] runs the app.