In the job definition, set the image as a map with an explicit entrypoint override to /usr/bin/env with a sane PATH, instead of using the bare image name. The hashicorp/packer image entrypoint otherwise intercepts the script lines and the build never runs. This is the same class of problem as any image whose entrypoint fights the CI runner: override the entrypoint and let the runner own the command line.

Context: Stack Overflow #58564430 (accepted answer, 7 votes): a GitLab pipeline using the hashicorp/packer image fails to run packer build. The self-verified fix is that the image ships with an entrypoint that swallows the script commands, so the job must override it.