Complete the Dockerfile line to set the base image to Alpine Linux, which is small and efficient.
FROM [1]Using alpine:latest as the base image helps keep the Docker image small and optimized.
Complete the Dockerfile command to remove package cache after installing packages to reduce image size.
RUN apk add --no-cache curl && [1]In Alpine Linux, /var/cache/apk/ holds package cache. Removing it reduces image size.
Fix the error in the Dockerfile line to copy only necessary files to keep the image small.
COPY [1] /app/Copying the build/ directory ensures only the compiled app files are included, avoiding unnecessary files like source code or dependencies.
Fill both blanks to create a multi-stage Dockerfile that builds and then copies only the final app.
FROM node:16-alpine AS builder RUN npm install && npm run build FROM alpine:latest COPY --from=builder [1] [2]
The build output is in /app/build in the builder stage, and it is copied to /app in the final image to keep it small.
Fill all three blanks to write a Dockerfile snippet that cleans up after installing packages and sets a working directory.
FROM alpine:latest RUN apk add --no-cache git [1] && [2] WORKDIR [3]
Installing bash adds a shell, cleaning cache reduces image size, and setting /app as working directory organizes files.