Start your terminal to use beginner mode.
Scenario
A Dockerfile at /home/interview/Dockerfile successfully builds a Go application, but the resulting Docker image is over 800MB in size due to including the full Go toolchain, build dependencies, and source code. Production images must be under 200MB.
Task
Rewrite the Dockerfile using a multi-stage build pattern to separate the build environment from the runtime environment. Use Alpine as the base image for the final runtime stage, ensure only the compiled binary and necessary runtime dependencies are copied to the final stage, build the optimized image with the tag myapp:fixed, and verify the final image size is below 200MB while maintaining full functionality.
Example
# Before (bloated image)
REPOSITORY TAG SIZE
myapp original 550MB
# After (optimized multi-stage build)
REPOSITORY TAG SIZE
myapp fixed 45.3MB
Terminal requires a larger screen
Open this page on a desktop or tablet (≥ 768px) to launch the terminal and practice hands-on.
Linux Terminal Environment
Write and execute your solution in the terminal below.
Shopify
Accenture
Coinbase
Adobe
EPAM
Twitch
Amazon
Kayak
Autodesk
Lyft
Revolut
RedHat
Bloomberg
Datadog
Palantir
TCS
HashiCorp
Google
DeutscheBank
GitHub
Apple
Cloudflare
Stripe
Microsoft
NVIDIA
GoDaddy
X
SAP
Spotify
Airbnb
Meta
Reddit
Yelp
Okta
Dropbox
Slack
ActivisionBlizzard
Zscaler
Uber
IBM
DeliveryHero
Robinhood
GitLab
Samsung
Elastic
Twilio
Netflix
CrowdStrike
Ubisoft
Anthropic
Capital One
Splunk
Intel
AMD
Databricks