Complete the Dockerfile to use a minimal base image for a Python app.
FROM [1] COPY app.py /app.py CMD ["python", "/app.py"]
The python:3.12-slim image is a minimal base image optimized for Python apps, reducing image size.
Complete the Dockerfile to reduce image size by removing cache after package installation.
FROM alpine:3.18 RUN apk add --no-cache [1] CMD ["sh"]
The --no-cache flag in apk add prevents caching of the package index, reducing image size.
Fix the error in the Dockerfile to use a minimal base image for a Node.js app.
FROM [1] COPY server.js /server.js CMD ["node", "/server.js"]
node:latest results in a larger image.ubuntu is not optimized for Node.js apps.The node:alpine image is a minimal base image for Node.js, reducing image size compared to node:latest.
Fill both blanks to create a Python Dockerfile that uses a minimal base image and installs packages without cache.
FROM [1] RUN apk add --no-cache [2] CMD ["python3"]
Use python:3.12-alpine for a minimal Python base image and --no-cache with apk add to avoid cache files.
Fill all three blanks to create a minimal Dockerfile that copies app files, installs dependencies without cache, and runs the app.
FROM [1] COPY [2] /app/ RUN pip install [3] -r /app/requirements.txt COPY app.py /app/ CMD ["python3", "/app/app.py"]
Use python:3.12-alpine for a small base image, copy requirements.txt to install dependencies, and use --no-cache-dir to avoid cache files.