0
0
Dockerdevops~10 mins

Targeting specific stages in Docker - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the Dockerfile line to name the build stage.

Docker
FROM alpine AS [1]
Drag options to blanks, or click blank then click option'
Astart
Bfinal
Cbuilder
Dbase
Attempts:
3 left
💡 Hint
Common Mistakes
Using reserved words like 'start' or 'final' without context.
2fill in blank
medium

Complete the COPY command to copy files from the 'builder' stage.

Docker
COPY --from=[1] /app/build /app
Drag options to blanks, or click blank then click option'
Abuilder
Bstart
Cbase
Dfinal
Attempts:
3 left
💡 Hint
Common Mistakes
Using a stage name that does not exist.
3fill in blank
hard

Fix the error in the FROM line to correctly name the stage.

Docker
FROM node AS [1]
Drag options to blanks, or click blank then click option'
Abuild_stage
Bbuild stage
Cbuild.stage
Dbuild-stage
Attempts:
3 left
💡 Hint
Common Mistakes
Using spaces or dots in stage names.
4fill in blank
hard

Fill both blanks to copy from the 'builder' stage and set the working directory.

Docker
COPY --from=[1] /src /app
WORKDIR [2]
Drag options to blanks, or click blank then click option'
Abuilder
B/app
C/src
Dfinal
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up source and destination paths.
5fill in blank
hard

Fill all three blanks to define a multi-stage build with a named stage, copy from it, and set the final command.

Docker
FROM golang:1.20 AS [1]
WORKDIR /app
RUN go build -o main .

FROM alpine
COPY --from=[2] /app/main /usr/local/bin/main
CMD ["[3]"]
Drag options to blanks, or click blank then click option'
Abuilder
Cmain
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using different names for the stage and COPY source.
Incorrect CMD syntax.