A lean container image that ships HashiCorp Packer pre-loaded with the plugins you actually need — ready to drop straight into your CI/CD pipelines.
Building machine images (VM templates, cloud images, containers) in CI shouldn't mean hand-rolling a Docker image every time you need a new Packer plugin. Packer CI does that work for you: it takes a minimal, security-conscious base image, installs Packer at a pinned version, and bakes in a curated set of plugins — all built and published automatically.
- HashiCorp Packer, pinned to an exact version (see
VERSION) — no surprises, no drift. - Pre-installed plugins, declared declaratively in
PLUGINSand downloaded straight from their source repositories at build time. - A minimal footprint, built on Alpine Linux.
- Fully automated builds via GitLab CI, including versioned tags and an optional
:latesttag.
Plugins are versioned independently of Packer itself — see PLUGINS for exact pinned versions. Each plugin's version is also recorded as an OCI label on the built image, so you can always inspect exactly what's inside a given tag.
Pull the image and run Packer just as you would locally:
docker run --rm -v "$PWD:/workspace" -w /workspace <your-registry>/packer-ci:<version> \
packer init .Or use it as the base for a CI job:
build-image:
image: <your-registry>/packer-ci:latest
script:
- packer init .
- packer build .The Dockerfile uses a multi-stage build:
- A
basestage installs common tooling (unzip,git,wget,jq, etc.) on top of Alpine Linux. - A
packerstage downloads and unpacks the pinned Packer release, then loops overPLUGINSto fetch and install each plugin binary for the target OS/architecture. - A final stage copies just the resulting binaries into a clean image, keeping the final footprint small.
The .gitlab-ci.yml pipeline drives the whole process: it reads the desired version from VERSION, appends plugin version labels to the Dockerfile, and builds/pushes the image — tagging :latest automatically when flagged in VERSION.
- Packer version: edit
versioninVERSION. latesttag: togglelatest("true"/"false") inVERSION.- Plugins: add, remove, or update entries under
pluginsinPLUGINS— each needs aname,version, andsource(GitHub repository URL).
This repository is licensed under the GNU General Public License v3.0.
In short: you're free to use, study, modify, and redistribute this code — including commercially — as long as any distributed modifications or derivative works are also released under the GPLv3 and keep their source available. It's a strong "copyleft" license, designed to guarantee that this project and anything built on top of it stay free and open for everyone downstream.
Note: this license covers the files in this repository (the Dockerfile, CI pipeline, and configuration). The Packer binary and plugins downloaded and bundled into the resulting container image are separate software with their own licenses — including Apache-2.0, BUSL-1.1, and MPL-2.0 — as declared in the image's
org.opencontainers.image.licenseslabel.
Maintained by Michael Poore.
