Skip to content

Commit fc6a5d3

Browse files
committed
Unify into single builder image
1 parent cbefec0 commit fc6a5d3

1 file changed

Lines changed: 21 additions & 27 deletions

File tree

stackable-base/Dockerfile

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,32 @@
77
# Build time dependencies that are used in multiple images can be added to `stackable-devel` (or a derivative like `java-devel`) instead
88
#
99

10-
FROM local-image/stackable-devel AS config-utils
10+
FROM local-image/stackable-devel AS rust-binaries
1111

1212
# Find the latest version here: https://github.com/stackabletech/config-utils/tags
1313
# renovate: datasource=github-tags packageName=stackabletech/config-utils
1414
ENV CONFIG_UTILS_VERSION=0.2.0
15-
16-
RUN <<EOF
17-
git clone --depth 1 --branch "${CONFIG_UTILS_VERSION}" https://github.com/stackabletech/config-utils
18-
cd ./config-utils
19-
. "$HOME/.cargo/env"
20-
cargo auditable --quiet build --release && cargo cyclonedx --all --spec-version 1.5 --describe binaries
21-
EOF
22-
23-
FROM local-image/stackable-devel AS containerdebug
24-
2515
# Find the latest version here: https://github.com/stackabletech/containerdebug/tags
2616
# renovate: datasource=github-tags packageName=stackabletech/containerdebug
2717
ENV CONTAINERDEBUG_VERSION=0.2.0
18+
# Find the latest version here: https://github.com/stackabletech/secret-operator/tags
19+
# I could not find support for prefixes or regex in https://docs.renovatebot.com/modules/datasource/github-tags/,
20+
# so I was unable to add a renovate hint.
21+
ENV CERT_TOOLS_VERSION=0.1.0
2822

29-
RUN <<EOF
30-
git clone --depth 1 --branch "${CONTAINERDEBUG_VERSION}" https://github.com/stackabletech/containerdebug
31-
cd ./containerdebug
32-
. "$HOME/.cargo/env"
33-
cargo auditable --quiet build --release && cargo cyclonedx --all --spec-version 1.5 --describe binaries
34-
EOF
35-
36-
FROM stackable/image/stackable-devel AS cert-tools
3723

3824
RUN <<EOF
39-
git clone --depth 1 --branch feat/truststore-merger https://github.com/stackabletech/secret-operator
40-
cd ./secret-operator
4125
. "$HOME/.cargo/env"
26+
27+
cd /
28+
git clone --depth 1 --branch "${CONFIG_UTILS_VERSION}" https://github.com/stackabletech/config-utils
29+
git clone --depth 1 --branch "${CONTAINERDEBUG_VERSION}" https://github.com/stackabletech/containerdebug
30+
git clone --depth 1 --branch "cert-tools-${CERT_TOOLS_VERSION}" https://github.com/stackabletech/secret-operator
31+
cd /config-utils
32+
cargo auditable --quiet build --release && cargo cyclonedx --all --spec-version 1.5 --describe binaries
33+
cd /containerdebug
34+
cargo auditable --quiet build --release && cargo cyclonedx --all --spec-version 1.5 --describe binaries
35+
cd /secret-operator
4236
cargo auditable --quiet build --release --package cert-tools && cargo cyclonedx --all --spec-version 1.5 --describe binaries
4337
EOF
4438

@@ -185,18 +179,18 @@ EOF
185179

186180
# **config-utils**
187181
# Utility to replace values in a file with values from environment variables and files
188-
COPY --from=config-utils --chown=${STACKABLE_USER_UID}:0 /config-utils/target/release/config-utils /stackable/config-utils
189-
COPY --from=config-utils --chown=${STACKABLE_USER_UID}:0 /config-utils/config-utils_bin.cdx.xml /stackable/config-utils.cdx.xml
182+
COPY --from=rust-binaries --chown=${STACKABLE_USER_UID}:0 /config-utils/target/release/config-utils /stackable/config-utils
183+
COPY --from=rust-binaries --chown=${STACKABLE_USER_UID}:0 /config-utils/config-utils_bin.cdx.xml /stackable/config-utils.cdx.xml
190184

191185
# **containerdebug**
192186
# Debug tool that logs generic system information.
193-
COPY --from=containerdebug --chown=${STACKABLE_USER_UID}:0 /containerdebug/target/release/containerdebug /stackable/containerdebug
194-
COPY --from=containerdebug --chown=${STACKABLE_USER_UID}:0 /containerdebug/containerdebug_bin.cdx.xml /stackable/containerdebug_bin.cdx.xml
187+
COPY --from=rust-binaries --chown=${STACKABLE_USER_UID}:0 /containerdebug/target/release/containerdebug /stackable/containerdebug
188+
COPY --from=rust-binaries --chown=${STACKABLE_USER_UID}:0 /containerdebug/containerdebug_bin.cdx.xml /stackable/containerdebug_bin.cdx.xml
195189

196190
# **cert-tools**
197191
# A CLI tool to merge two truststores in PEM or PKCS12 format in such as way that they are accepted by the JVM
198-
COPY --from=cert-tools --chown=${STACKABLE_USER_UID}:0 /secret-operator/target/release/cert-tools /stackable/cert-tools
199-
COPY --from=cert-tools --chown=${STACKABLE_USER_UID}:0 /secret-operator/rust/cert-tools/cert-tools_bin.cdx.xml /stackable/cert-tools_bin.cdx.xml
192+
COPY --from=rust-binaries --chown=${STACKABLE_USER_UID}:0 /secret-operator/target/release/cert-tools /stackable/cert-tools
193+
COPY --from=rust-binaries --chown=${STACKABLE_USER_UID}:0 /secret-operator/rust/cert-tools/cert-tools_bin.cdx.xml /stackable/cert-tools_bin.cdx.xml
200194

201195
# **check-permissions-ownership.sh**
202196
# Bash script to check proper permissions and ownership requirements in the final Stackable images

0 commit comments

Comments
 (0)