hashicorp/docker-build

Builds and stores Docker images.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit Apr 28, 2026
License
MPL 2.0

Pinned Snippet

workflow.ymlSHA-pinned
uses: hashicorp/actions-docker-build@e12557abf02a40557313ab2839d6cd2c6705261e # v2.2.1

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
versionVersion of the product, e.g. "X.Y.Z[-pre][+edition]".yes
archTarget image architecture.yes
revisionFull sha of the commit that is being built. This may differ from the default <github.sha> which is the ref the action was invoked at. ${{ github.sha }}
tagsWhitespace-separated fully-qualified image names to use for production releases. If you set tags non-empty, then the redhat_tag input must be empty. Each tag must be in the format: <registry>/[<namespace>/]<repository>:<tag> ""
redhat_tagSingle tag to use for pushing to Red Hat Certified Container Project. If you set redhat_tag non-empty, then the tags input must be empty. Each tag must be in the format: <registry>/[<namespace>/]<repository>:<tag> ""
targetDockerfile target stage to build. You should set this explicitly if your Dockerfile contains more than one target. You should use the target name (i.e. FROM ... AS <target name>) not the index. Defaults to 0, meaning the first target defined (fine if only one target). 0
arm_versionVersion of arm architecture to use (ignored unless arch == arm).6
smoke_testBash shell script to run as a smoke test against the built image. Inside the script, you will have access to a variable called 'IMAGE_NAME' which you can use in your test to run the image. The script currently only run against the `linux/amd64` build and will have access to a local docker daemon. Tests should not be specific to `amd64` arch nor rely on the daemon being local as these may change later to enable testing to all other images. The script must exit non-zero in order to mark the test as failed. no""
zip_artifact_nameName of zip file artifact to download. If left empty defaults to ${PKG_NAME}_${OS}_${ARCH}.zip. ""
pkg_nameOnly used to determine default zip name. Defaults to <repo-name(minus -enterprise)>_<version>[+ent] if left blank. ""
bin_nameName of the product binary inside the zip file. If empty (which is the default) then the name is guessed using repo name with any -enteprise suffix removed. ""
dev_tagsTags to use for publishing development images (optional).""
push_auto_dev_tagsTag to determine whether to push default dev tags (optional).false
extra_build_argsWhitespace-separated list of extra build arguments that get passed to docker build (optional). ""
workdirWorking directory in which to run 'docker build'..
dockerfileDockerfile path relative to workdir.Dockerfile
do_zip_extract_stepShould zip archives be extracted? (optional)true
ssh_private_keyssh private key""
compression_levelactions upload artifact compression level6

no outputs