Sign inSign up free

838. exec format error on arm64

medium 20 XP ~9 minHands-on lab

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

The reviews tools image is built for linux/amd64 and linux/arm64. On the new arm64 nodes it fails at once:

exec /usr/local/bin/kubectl: exec format error

Task

Fix /home/student/projects/reviews/Dockerfile so that the kubectl download matches the platform being built:

  • declare the automatic build argument TARGETARCH in the stage and use it in the download URL (…/bin/linux/${TARGETARCH}/kubectl),
  • no architecture name (amd64, arm64, x86_64, aarch64) may appear anywhere in the Dockerfile,
  • verify the download: fetch the published kubectl.sha256 from the same location and check it with sha256sum (the build must fail on a mismatch),
  • keep KUBECTL_VERSION and the ENTRYPOINT.

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: Run Tests in Their Own Build Stage

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.