When a FROM scratch Container Image Is Not Good Enough
Premium Challenge
Upgrade your membership to unlock this and all other premium materials.
In this challenge, you'll need to troubleshoot a misbehaving container, identify the problem, and then restart the container, potentially rebuilding its image, to make the containerized application actually work.
The application is a simple web server that, upon receiving a request,
calls the GitHub status API
and proxies the response back to the client.
You can access the application at http://localhost:8080.
The following conditions should be met for the solution to be accepted:
- The application container should be named
status-checker. - The application container should be listening on port
8080. - The unmodified
serverbinary from the original image must be used.
Additionally, you'll need to make sure that the container still adheres to DevOps best practices:
- The container image size should be less than 50MB.
- There should be no shell in the container.
The image size is the sum of its uncompressed layers, as listed by docker history <image>.
The DISK USAGE column of docker images and the Size field of docker image inspect may show a bigger number.
Since Docker 29.8, they also count the compressed copies of the layers that Docker keeps on disk.
You can start, stop, and remove the container as many times as you want, using its original image or replacing it with your own.
Good luck!
Hint 1
Try sending an HTTP request to the application. The response may contain a clue.
Hint 2
Even when your application is a single statically linked binary,
building a container image FROM scratch might be not the best idea.
Hint 4
Follow the dynamic hints of the solution checker.
