Complete the Dockerfile to use a small base image for a Python app.
FROM python:[1] COPY app.py /app/ CMD ["python", "/app/app.py"]
Using python:alpine gives a small base image, which reduces image size and speeds up downloads.
Complete the Dockerfile to use a slim version of Node.js base image.
FROM node:[1] WORKDIR /app COPY package.json ./ RUN npm install COPY . . CMD ["node", "index.js"]
The node:slim image is smaller than the full version but includes more tools than alpine.
Fix the error in the Dockerfile to use Alpine base image for a Go app.
FROM golang:[1] WORKDIR /go/src/app COPY . . RUN go build -o app CMD ["./app"]
Using golang:alpine provides a small base image suitable for Go apps.
Fill both blanks to create a Python dictionary comprehension that filters packages by size and uses a small base image.
packages = {pkg: size for pkg, size in package_sizes.items() if size [1] 50 and pkg.startswith('[2]')}The comprehension filters packages smaller than 50 and starting with 'alpine', a small base image.
Fill all three blanks to create a Dockerfile snippet that uses a small base image, sets working directory, and runs a command.
FROM [1] WORKDIR [2] CMD ["[3]"]
This Dockerfile uses the small python:alpine image, sets the working directory to /app, and runs the python command.