Complete the code to specify the base image for a Dockerfile used in ML workloads.
FROM [1]The FROM instruction sets the base image. For ML workloads, a Python image like python:3.9-slim is commonly used.
Complete the Dockerfile command to copy your ML model files into the container.
COPY [1] /app/model/src/ or data/.The COPY command copies files from your local model/ directory into the container's /app/model/ directory.
Fix the error in the Dockerfile command to install Python dependencies from requirements.txt.
RUN pip install [1] requirements.txtThe pip install command requires the -r flag to install packages listed in a requirements file.
Fill both blanks to expose port 5000 and set the command to run the ML app.
EXPOSE [1] CMD ["python", "[2]"]
Port 5000 is commonly used for ML web apps. The command runs app.py using Python.
Fill all three blanks to create a Docker volume, mount it, and set environment variable for data path.
VOLUME ["[1]"] RUN mkdir -p [2] ENV DATA_PATH=[3]
Using /data as the volume path, creating it, and setting DATA_PATH to /data keeps data consistent inside the container.