Unable to Locate Package, Months Later
Labs have no container engine, so nothing is built: your files are checked by reading them.
Someone added git to the image of cart and the build failed:
E: Unable to locate package git
The apt-get update layer came from the build cache, months old. The image is also 150 MB bigger than it needs to be.
Rewrite the package installation in /home/student/projects/cart/Dockerfile so that:
RUN does all the apt work: apt-get update followed by apt-get install in that same RUN,-y) and skips recommended packages (--no-install-recommends),ca-certificates, curl, git and python3 (ca-certificates is needed by curl once recommends are skipped),RUN ends by deleting /var/lib/apt/lists/*.Keep the rest of the Dockerfile.
About this machine
Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.
Part of Docker Fundamentals. Next step: Copy a Tool From Its Image Instead of curl | sh
Teaching or writing about this? Embed this lab on your page
Your machine is ready to start
A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.
No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.