11---
2- name : Build Product Image
3- description : This action builds a product Docker image with a specific version
2+ name : Build Container Image
3+ description : This action builds a container image with a specific version
44inputs :
55 image-name :
66 description : |
@@ -12,11 +12,14 @@ inputs:
1212 Human-readable tag (usually the version) without architecture information,
1313 for example: `3.4.1-stackable0.0.0-dev`
1414 container-file :
15- description : Path to Containerfile (or Dockefile )
15+ description : Path to Containerfile (or Dockerfile )
1616 default : Dockerfile
1717 build-context :
1818 description : Path to the build-context
1919 default : .
20+ build-arguments :
21+ description : |
22+ A comma-separated list of KEY=VALUE pairs provided as build arguments
2023outputs :
2124 image-repository-uri :
2225 description : |
@@ -45,10 +48,13 @@ runs:
4548 IMAGE_INDEX_MANIFEST_TAG : ${{ inputs.image-index-manifest-tag }}
4649 CONTAINER_FILE : ${{ inputs.container-file }}
4750 BUILD_CONTEXT : ${{ inputs.build-context }}
51+ BUILD_ARGUMENTS : ${{ inputs.build-arguments }}
4852 shell : bash
4953 run : |
5054 set -euo pipefail
5155
56+ DOCKER_BUILD_ARGUMENTS=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_build_arguments.sh" "$BUILD_ARGUMENTS")
57+
5258 IMAGE_ARCH=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_architecture.sh")
5359 echo "IMAGE_ARCH=${IMAGE_ARCH}" | tee -a "$GITHUB_ENV"
5460
@@ -64,11 +70,12 @@ runs:
6470 echo "::group::docker buildx build"
6571 # TODO (@NickLarsenNZ): Allow optional buildx cache
6672 docker buildx build \
67- --file "${CONTAINER_FILE}" \
68- --platform "linux/${IMAGE_ARCH}" \
69- --tag "${IMAGE_MANIFEST_URI}" \
70- --load \
71- "${BUILD_CONTEXT}"
73+ --file "${CONTAINER_FILE}" \
74+ --platform "linux/${IMAGE_ARCH}" \
75+ --tag "${IMAGE_MANIFEST_URI}" \
76+ --load \
77+ $DOCKER_BUILD_ARGUMENTS \
78+ "${BUILD_CONTEXT}"
7279 echo "::endgroup::"
7380
7481 echo "::group::docker images"
0 commit comments