1
1
---
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
4
4
inputs :
5
5
image-name :
6
6
description : |
@@ -12,11 +12,14 @@ inputs:
12
12
Human-readable tag (usually the version) without architecture information,
13
13
for example: `3.4.1-stackable0.0.0-dev`
14
14
container-file :
15
- description : Path to Containerfile (or Dockefile )
15
+ description : Path to Containerfile (or Dockerfile )
16
16
default : Dockerfile
17
17
build-context :
18
18
description : Path to the build-context
19
19
default : .
20
+ build-arguments :
21
+ description : |
22
+ A comma-separated list of KEY=VALUE pairs provided as build arguments
20
23
outputs :
21
24
image-repository-uri :
22
25
description : |
@@ -45,10 +48,13 @@ runs:
45
48
IMAGE_INDEX_MANIFEST_TAG : ${{ inputs.image-index-manifest-tag }}
46
49
CONTAINER_FILE : ${{ inputs.container-file }}
47
50
BUILD_CONTEXT : ${{ inputs.build-context }}
51
+ BUILD_ARGUMENTS : ${{ inputs.build-arguments }}
48
52
shell : bash
49
53
run : |
50
54
set -euo pipefail
51
55
56
+ DOCKER_BUILD_ARGUMENTS=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_build_arguments.sh" "$BUILD_ARGUMENTS")
57
+
52
58
IMAGE_ARCH=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_architecture.sh")
53
59
echo "IMAGE_ARCH=${IMAGE_ARCH}" | tee -a "$GITHUB_ENV"
54
60
@@ -64,11 +70,12 @@ runs:
64
70
echo "::group::docker buildx build"
65
71
# TODO (@NickLarsenNZ): Allow optional buildx cache
66
72
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}"
72
79
echo "::endgroup::"
73
80
74
81
echo "::group::docker images"
0 commit comments