Sign inSign up free

829. Copy a Tool From Its Image Instead of curl | sh

easy 10 XP ~7 minHands-on lab

Labs have no container engine, so nothing is built: your files are checked by reading them.

The image-resizer image installs the Python package manager uv with curl … | sh: whatever that script contains today runs as root in the build, the version isn't pinned, and curl stays in the image.

Task

Change /home/student/projects/image-resizer/Dockerfile so that:

  • uv and uvx are copied from the official image ghcr.io/astral-sh/uv:0.5.4 (the binaries are at /uv and /uvx in it) into /bin/, with a single COPY --from=…,
  • there's no curl, no install script, no apt-get and no /root/.local PATH change left,
  • the dependency install (uv sync --frozen --no-dev), the copies and the CMD stay as they are.

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: Pin Base Images by Digest

Teaching or writing about this? Embed this lab on your page

TerminalNot started

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.