Complete the Dockerfile to name the first build stage as 'builder'.
FROM node:18 AS [1] WORKDIR /app COPY package.json ./ RUN npm install
The AS builder syntax names the build stage 'builder'. This name can be used later to refer to this stage.
Complete the Dockerfile to copy files from the named build stage 'builder'.
FROM nginx:alpine COPY --from=[1] /app/build /usr/share/nginx/html
The --from=builder option copies files from the build stage named 'builder'.
Fix the error in the Dockerfile by correctly naming the build stage.
FROM python:3.12 AS [1] WORKDIR /app COPY requirements.txt ./ RUN pip install -r requirements.txt
Using 'builder' as the stage name is a clear and common convention for build stages.
Fill both blanks to create a multi-stage Dockerfile that builds and then copies from the 'builder' stage.
FROM golang:1.20 AS [1] WORKDIR /src COPY . . RUN go build -o app FROM alpine:latest COPY --from=[2] /src/app /usr/local/bin/app
Both blanks should be 'builder' to name the build stage and copy from it correctly.
Fill all three blanks to create a multi-stage Dockerfile with named stages and copy commands.
FROM rust:1.70 AS [1] WORKDIR /app COPY . . RUN cargo build --release FROM debian:buster-slim AS [2] COPY --from=[3] /app/target/release/myapp /usr/local/bin/myapp
The first stage is named 'builder', the second stage is 'final', and the copy command uses '--from=builder' to get the built app.