Skip to content

Commit de216a0

Browse files
dervoetistackable-botlfranckerazvanmaltesander
authored
feat: include source code (#1126)
* feat: include source code of components / migrate some components to patchable * chore(deps): update docker/dockerfile docker tag to v1.15.1 (#1120) | datasource | package | from | to | | ---------- | ----------------- | ------ | ------ | | docker | docker/dockerfile | 1.10.0 | 1.15.1 | * chore: Update pre-commit dependencies (#1123) * chore(kafka): update images for release 25.7.0 (#1117) * remove 3.7.1 and 3.8.0 * add 4.0.0 * update changelog * bump to java 23 for kafka 4.0.0 * fix kcat image name * chore: stop building kcat image (#1124) * chore: stop building kcat image * fix: adjust kafka / kafka-testing-tools watched paths * chore: changelog / hadolint fix * fix: missing patchable config for protobuf * Update hadoop/Dockerfile Co-authored-by: Malte Sander <[email protected]> * chore: move chmod to builder step * fix: spark build --------- Co-authored-by: Stacky McStackface <[email protected]> Co-authored-by: Lars Francke <[email protected]> Co-authored-by: Razvan-Daniel Mihai <[email protected]> Co-authored-by: Malte Sander <[email protected]>
1 parent 14568bc commit de216a0

File tree

36 files changed

+199
-57
lines changed

36 files changed

+199
-57
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ All notable changes to this project will be documented in this file.
4646
- omid: bump version to 1.1.3 ([#1105])
4747
- hbase: add 2.6.2 and upgrade dependencies ([#1101])
4848
- kafka: Add `4.0.0` ([#1117])
49+
- Include `.tar.gz` snapshots of the product source code in container images ([#1126])
4950

5051
### Changed
5152

@@ -145,6 +146,7 @@ All notable changes to this project will be documented in this file.
145146
[#1122]: https://github.com/stackabletech/docker-images/pull/1122
146147
[#1124]: https://github.com/stackabletech/docker-images/pull/1124
147148
[#1125]: https://github.com/stackabletech/docker-images/pull/1125
149+
[#1126]: https://github.com/stackabletech/docker-images/pull/1126
148150
[#1128]: https://github.com/stackabletech/docker-images/pull/1128
149151

150152
## [25.3.0] - 2025-03-21

druid/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ RUN --mount=type=cache,id=maven-${PRODUCT},uid=${STACKABLE_USER_UID},target=/sta
5454
cd "$(cat /tmp/DRUID_SOURCE_DIR)" || exit 1
5555
rm /tmp/DRUID_SOURCE_DIR
5656

57+
# Create snapshot of the source code including custom patches
58+
tar -czf /stackable/druid-${PRODUCT}-src.tar.gz .
59+
5760
mvn \
5861
--batch-mode \
5962
--no-transfer-progress \
@@ -120,6 +123,7 @@ LABEL io.k8s.display-name="${NAME}"
120123

121124

122125
COPY --chown=${STACKABLE_USER_UID}:0 --from=druid-builder /stackable/apache-druid-${PRODUCT} /stackable/apache-druid-${PRODUCT}
126+
COPY --chown=${STACKABLE_USER_UID}:0 --from=druid-builder /stackable/druid-${PRODUCT}-src.tar.gz /stackable
123127

124128
COPY --chown=${STACKABLE_USER_UID}:0 druid/stackable/bin /stackable/bin
125129
COPY --chown=${STACKABLE_USER_UID}:0 druid/licenses /licenses

hadoop/Dockerfile

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,40 @@ ARG TARGETARCH
1111
ARG TARGETOS
1212
ARG STACKABLE_USER_UID
1313

14+
WORKDIR /stackable
15+
16+
COPY --chown=${STACKABLE_USER_UID}:0 shared/protobuf/stackable/patches/patchable.toml /stackable/src/shared/protobuf/stackable/patches/patchable.toml
17+
COPY --chown=${STACKABLE_USER_UID}:0 shared/protobuf/stackable/patches/${PROTOBUF} /stackable/src/shared/protobuf/stackable/patches/${PROTOBUF}
18+
19+
RUN <<EOF
20+
rpm --install --replacepkgs https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
21+
microdnf update
22+
# boost is a build dependency starting in Hadoop 3.4.0 if compiling native code
23+
# automake and libtool are required to build protobuf
24+
microdnf install boost1.78-devel automake libtool
25+
microdnf clean all
26+
rm -rf /var/cache/yum
27+
EOF
28+
1429
# This Protobuf version is the exact version as used in the Hadoop Dockerfile
1530
# See https://github.com/apache/hadoop/blob/trunk/dev-support/docker/pkg-resolver/install-protobuf.sh
1631
# (this was hardcoded in the Dockerfile in earlier versions of Hadoop, make sure to look at the exact version in Github)
17-
WORKDIR /opt/protobuf-src
1832
RUN <<EOF
19-
curl https://repo.stackable.tech/repository/packages/protobuf/protobuf-java-${PROTOBUF}.tar.gz -o /opt/protobuf.tar.gz
20-
tar xzf /opt/protobuf.tar.gz --strip-components 1 --no-same-owner
33+
cd "$(/stackable/patchable --images-repo-root=src checkout shared/protobuf ${PROTOBUF})"
34+
35+
# Create snapshot of the source code including custom patches
36+
tar -czf /stackable/protobuf-${PROTOBUF}-src.tar.gz .
37+
38+
./autogen.sh
2139
./configure --prefix=/opt/protobuf
2240
make "-j$(nproc)"
2341
make install
24-
rm -rf /opt/protobuf-src
42+
(cd .. && rm -r ${PROTOBUF})
2543
EOF
2644

2745
ENV PROTOBUF_HOME=/opt/protobuf
2846
ENV PATH="${PATH}:/opt/protobuf/bin"
2947

30-
RUN <<EOF
31-
rpm --install --replacepkgs https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
32-
microdnf update
33-
# boost is a build dependency starting in Hadoop 3.4.0 if compiling native code
34-
microdnf install boost1.78-devel
35-
microdnf clean all
36-
rm -rf /var/cache/yum
37-
EOF
38-
39-
WORKDIR /stackable
4048
RUN <<EOF
4149
# async-profiler
4250
ARCH="${TARGETARCH/amd64/x64}"
@@ -63,6 +71,9 @@ COPY --chown=${STACKABLE_USER_UID}:0 hadoop/stackable/jmx /stackable/jmx
6371
RUN <<EOF
6472
cd "$(/stackable/patchable --images-repo-root=src checkout hadoop ${PRODUCT})"
6573

74+
# Create snapshot of the source code including custom patches
75+
tar -czf /stackable/hadoop-${PRODUCT}-src.tar.gz .
76+
6677
mvn \
6778
--batch-mode \
6879
--no-transfer-progress \
@@ -125,14 +136,20 @@ EOF
125136
ENV JAVA_HOME="/usr/lib/jvm/temurin-17-jdk"
126137

127138
USER ${STACKABLE_USER_UID}
128-
WORKDIR /build
139+
WORKDIR /stackable
140+
141+
COPY --chown=${STACKABLE_USER_UID}:0 hadoop/hdfs-utils/stackable/patches/patchable.toml /stackable/src/hadoop/hdfs-utils/stackable/patches/patchable.toml
142+
COPY --chown=${STACKABLE_USER_UID}:0 hadoop/hdfs-utils/stackable/patches/${HDFS_UTILS} /stackable/src/hadoop/hdfs-utils/stackable/patches/${HDFS_UTILS}
143+
129144
# The Stackable HDFS utils contain an OPA authorizer, group mapper & topology provider.
130145
# The topology provider provides rack awareness functionality for HDFS by allowing users to specify Kubernetes
131146
# labels to build a rackID from.
132147
# Starting with hdfs-utils version 0.3.0 the topology provider is not a standalone jar anymore and included in hdfs-utils.
133148
RUN <<EOF
134-
curl "https://github.com/stackabletech/hdfs-utils/archive/refs/tags/v${HDFS_UTILS}.tar.gz" | tar -xzC .
135-
cd hdfs-utils-${HDFS_UTILS}
149+
cd "$(/stackable/patchable --images-repo-root=src checkout hadoop/hdfs-utils ${HDFS_UTILS})"
150+
151+
# Create snapshot of the source code including custom patches
152+
tar -czf /stackable/hdfs-utils-${HDFS_UTILS}-src.tar.gz .
136153

137154
mvn \
138155
--batch-mode \
@@ -147,7 +164,7 @@ cp target/hdfs-utils-$HDFS_UTILS.jar /stackable/hdfs-utils-${HDFS_UTILS}.jar
147164
rm -rf hdfs-utils-main
148165

149166
# Set correct groups
150-
chmod g=u /stackable/hdfs-utils-${HDFS_UTILS}.jar
167+
chmod g=u /stackable/hdfs-utils-${HDFS_UTILS}.jar /stackable/hdfs-utils-${HDFS_UTILS}-src.tar.gz
151168
EOF
152169

153170
FROM stackable/image/java-base AS final
@@ -168,6 +185,7 @@ LABEL \
168185

169186
COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder /stackable /stackable
170187
COPY --chown=${STACKABLE_USER_UID}:0 --from=hdfs-utils-builder /stackable/hdfs-utils-${HDFS_UTILS}.jar /stackable/hadoop-${PRODUCT}/share/hadoop/common/lib/hdfs-utils-${HDFS_UTILS}.jar
188+
COPY --chown=${STACKABLE_USER_UID}:0 --from=hdfs-utils-builder /stackable/hdfs-utils-${HDFS_UTILS}-src.tar.gz /stackable
171189

172190
COPY --chown=${STACKABLE_USER_UID}:0 hadoop/licenses /licenses
173191

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
base = "cf24929fad3da02e530151d5ac66802cd5fa4109"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
base = "fb9bd978a3c855984e93f1a6407c57d62fa34733"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
upstream = "https://github.com/stackabletech/hdfs-utils.git"

hbase/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ RUN --mount=type=cache,id=maven-hbase-${PRODUCT},uid=${STACKABLE_USER_UID},targe
4949
###
5050
cd "$(/stackable/patchable --images-repo-root=src checkout hbase ${PRODUCT})"
5151

52+
# Create snapshot of the source code including custom patches
53+
tar -czf /stackable/hbase-${PRODUCT}-src.tar.gz .
54+
5255
# The release scripts of HBase also run the build twice (three times in fact, once again to build the site which we skip here).
5356
# I chose to replicate that exact behavior for consistency so please don't merge the two mvn runs into one unless you really know what you're doing!
5457
# Cannot skip building tests here because the assembly plugin needs a shell script from the test directory.
@@ -146,6 +149,8 @@ ARG RELEASE
146149
ARG HADOOP
147150
ARG HBASE_PROFILE
148151
ARG HBASE_HBASE_OPERATOR_TOOLS
152+
ARG HBASE_HBASE_OPA_AUTHORIZER
153+
ARG HBASE_PHOENIX
149154
ARG STACKABLE_USER_UID
150155

151156
ARG NAME="Apache HBase"
@@ -171,13 +176,16 @@ LABEL io.k8s.description="${DESCRIPTION}"
171176
LABEL io.k8s.display-name="${NAME}"
172177

173178
COPY --chown=${STACKABLE_USER_UID}:0 --from=hbase-builder /stackable/hbase-${PRODUCT} /stackable/hbase-${PRODUCT}/
179+
COPY --chown=${STACKABLE_USER_UID}:0 --from=hbase-builder /stackable/hbase-${PRODUCT}-src.tar.gz /stackable
174180
COPY --chown=${STACKABLE_USER_UID}:0 --from=hbase-builder /stackable/async-profiler /stackable/async-profiler/
175181

176182
COPY --chown=${STACKABLE_USER_UID}:0 --from=hbase-operator-tools /stackable/hbase-operator-tools-${HBASE_HBASE_OPERATOR_TOOLS} /stackable/hbase-operator-tools-${HBASE_HBASE_OPERATOR_TOOLS}/
183+
COPY --chown=${STACKABLE_USER_UID}:0 --from=hbase-operator-tools /stackable/hbase-operator-tools-${HBASE_HBASE_OPERATOR_TOOLS}-src.tar.gz /stackable
177184
COPY --chown=${STACKABLE_USER_UID}:0 --from=hbase-operator-tools /stackable/bin/hbck2 /stackable/bin/hbck2
178185
COPY --chown=${STACKABLE_USER_UID}:0 --from=hbase-operator-tools /stackable/bin/hbase-entrypoint.sh /stackable/hbase-${PRODUCT}/bin/hbase-entrypoint.sh
179186

180187
COPY --chown=${STACKABLE_USER_UID}:0 --from=phoenix /stackable/phoenix /stackable/phoenix/
188+
COPY --chown=${STACKABLE_USER_UID}:0 --from=phoenix /stackable/phoenix-${HBASE_PHOENIX}-src.tar.gz /stackable
181189

182190
COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-s3-builder /stackable/bin/export-snapshot-to-s3 /stackable/bin/export-snapshot-to-s3
183191
COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-s3-builder /stackable/hadoop/share/hadoop/tools/lib/ /stackable/hadoop/share/hadoop/tools/lib/
@@ -190,6 +198,7 @@ COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder \
190198
/stackable/hadoop/share/hadoop/tools/lib/hadoop-azure-${HADOOP}.jar \
191199
/stackable/hbase-${PRODUCT}/lib/
192200

201+
COPY --chown=${STACKABLE_USER_UID}:0 --from=hbase-opa-authorizer /stackable/hbase-opa-authorizer-${HBASE_HBASE_OPA_AUTHORIZER}-src.tar.gz /stackable
193202
COPY --chown=${STACKABLE_USER_UID}:0 --from=hbase-opa-authorizer /stackable/hbase-opa-authorizer/target/hbase-opa-authorizer*.jar /stackable/hbase-${PRODUCT}/lib
194203

195204
RUN <<EOF
@@ -226,6 +235,7 @@ chmod g=u "/stackable/hbase/lib/phoenix-server-hbase-${HBASE_PROFILE}.jar"
226235
chmod g=u /stackable/async-profiler
227236
chmod g=u /stackable/bin
228237
chmod g=u /stackable/phoenix
238+
chmod g=u /stackable/*-src.tar.gz
229239
# the whole directory tree /stackable/hadoop/share/hadoop/tools/lib/ must be adapted
230240
find /stackable/hadoop -type d -exec chmod g=u {} +
231241
EOF

hbase/hbase-opa-authorizer/Dockerfile

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,34 @@ ARG STACKABLE_USER_UID
77
USER ${STACKABLE_USER_UID}
88
WORKDIR /stackable
99

10+
COPY --chown=${STACKABLE_USER_UID}:0 hbase/hbase-opa-authorizer/stackable/patches/patchable.toml /stackable/src/hbase/hbase-opa-authorizer/stackable/patches/patchable.toml
11+
COPY --chown=${STACKABLE_USER_UID}:0 hbase/hbase-opa-authorizer/stackable/patches/${PRODUCT} /stackable/src/hbase/hbase-opa-authorizer/stackable/patches/${PRODUCT}
12+
1013
RUN --mount=type=cache,id=maven-opa,uid=${STACKABLE_USER_UID},target=/stackable/.m2/repository <<EOF
1114
###
1215
### OPA Authorizer (only for 2.6 upwards)
1316
###
1417
if [[ -n "$PRODUCT" ]]; then
15-
git clone --depth 1 --branch "$PRODUCT" https://github.com/stackabletech/hbase-opa-authorizer.git
18+
cd "$(/stackable/patchable --images-repo-root=src checkout hbase/hbase-opa-authorizer ${PRODUCT})"
19+
20+
# Create snapshot of the source code including custom patches
21+
tar -czf /stackable/hbase-opa-authorizer-${PRODUCT}-src.tar.gz .
1622
mvn \
1723
--batch-mode \
1824
--no-transfer-progress \
1925
-DskipTests \
2026
-Dmaven.test.skip=true \
21-
-fhbase-opa-authorizer \
2227
package
2328
else
24-
# Create a dummy jar to avoid errors when copying it the final image
25-
mkdir -p hbase-opa-authorizer/target
26-
touch hbase-opa-authorizer/target/hbase-opa-authorizer.jar
29+
# Create a dummy jar to avoid errors when copying it to the final image
30+
mkdir -p target
31+
touch target/hbase-opa-authorizer.jar
32+
touch /stackable/hbase-opa-authorizer-${PRODUCT}-src.tar.gz
2733
fi
2834

35+
mkdir /stackable/hbase-opa-authorizer
36+
mv target /stackable/hbase-opa-authorizer
37+
2938
if [ "${DELETE_CACHES}" = "true" ] ; then
3039
rm -rf /stackable/.m2/repository/*
3140
fi
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
base = "c7eb27ca6a162bbfdb98262ba69e40d109f1fdd4"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
upstream = "https://github.com/stackabletech/hbase-opa-authorizer.git"

hbase/hbase-operator-tools/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ ARG DELETE_CACHES="true"
1414
# so that they are not expanded. Disabling ShellCheck rules in a Dockerfile
1515
# does not work, so please ignore the according warning (SC2016).
1616
COPY --chown=${STACKABLE_USER_UID}:0 hbase/stackable/bin/hbck2.env /stackable/bin/
17-
COPY --chown=${STACKABLE_USER_UID}:0 hbase/hbase-operator-tools/stackable/patches/patchable.toml /stackable/src/hbase-operator-tools/stackable/patches/patchable.toml
18-
COPY --chown=${STACKABLE_USER_UID}:0 hbase/hbase-operator-tools/stackable/patches/${PRODUCT} /stackable/src/hbase-operator-tools/stackable/patches/${PRODUCT}
17+
COPY --chown=${STACKABLE_USER_UID}:0 hbase/hbase-operator-tools/stackable/patches/patchable.toml /stackable/src/hbase/hbase-operator-tools/stackable/patches/patchable.toml
18+
COPY --chown=${STACKABLE_USER_UID}:0 hbase/hbase-operator-tools/stackable/patches/${PRODUCT} /stackable/src/hbase/hbase-operator-tools/stackable/patches/${PRODUCT}
1919
COPY --chown=${STACKABLE_USER_UID}:0 hbase/stackable/bin/hbase-entrypoint.sh /stackable/bin/
2020

2121
USER ${STACKABLE_USER_UID}
@@ -24,7 +24,10 @@ WORKDIR /stackable
2424
# Cache mounts are owned by root by default
2525
# We need to explicitly give the uid to use
2626
RUN --mount=type=cache,id=maven-hbase-operator-tools-${PRODUCT},uid=${STACKABLE_USER_UID},target=/stackable/.m2/repository <<EOF
27-
cd "$(/stackable/patchable --images-repo-root=src checkout hbase-operator-tools ${PRODUCT})"
27+
cd "$(/stackable/patchable --images-repo-root=src checkout hbase/hbase-operator-tools ${PRODUCT})"
28+
29+
# Create snapshot of the source code including custom patches
30+
tar -czf /stackable/hbase-operator-tools-$PRODUCT-src.tar.gz .
2831

2932
mvn \
3033
--batch-mode \

hbase/phoenix/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ WORKDIR /stackable
1919
RUN --mount=type=cache,id=maven-phoenix-${PRODUCT},uid=${STACKABLE_USER_UID},target=/stackable/.m2/repository <<EOF
2020
cd "$(/stackable/patchable --images-repo-root=src checkout phoenix ${PRODUCT})"
2121

22+
# Create snapshot of the source code including custom patches
23+
tar -czf /stackable/phoenix-$PRODUCT-src.tar.gz .
24+
2225
# The Maven command can be found inside of the scripts in the create-release folder (release-util.sh as of Phoenix 5.2.0)
2326
# https://github.com/apache/phoenix/tree/5.2.0/dev/create-release
2427
mvn \

hive/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ RUN --mount=type=cache,id=maven-hive-${PRODUCT},uid=${STACKABLE_USER_UID},target
3939
BUILD_SRC_DIR="$(/stackable/patchable --images-repo-root=src checkout hive ${PRODUCT})"
4040
cd "$BUILD_SRC_DIR"
4141

42+
# Create snapshot of the source code including custom patches
43+
tar -czf /stackable/hive-${PRODUCT}-src.tar.gz .
44+
4245
if [[ "${PRODUCT}" == "3.1.3" ]] ; then
4346
mvn --batch-mode --no-transfer-progress clean package -DskipTests --projects standalone-metastore
4447
mv standalone-metastore/target/apache-hive-metastore-${PRODUCT}-bin/apache-hive-metastore-${PRODUCT}-bin /stackable
@@ -127,7 +130,9 @@ LABEL io.k8s.display-name="${NAME}"
127130
WORKDIR /stackable
128131

129132
COPY --chown=${STACKABLE_USER_UID}:0 --from=hive-builder /stackable/apache-hive-metastore-${PRODUCT}-bin /stackable/apache-hive-metastore-${PRODUCT}-bin
133+
COPY --chown=${STACKABLE_USER_UID}:0 --from=hive-builder /stackable/hive-${PRODUCT}-src.tar.gz /stackable
130134
COPY --chown=${STACKABLE_USER_UID}:0 --from=hive-builder /stackable/hadoop-${HADOOP} /stackable/hadoop-${HADOOP}
135+
COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder /stackable/hadoop-${HADOOP}-src.tar.gz /stackable
131136
COPY --chown=${STACKABLE_USER_UID}:0 --from=hive-builder /stackable/jmx /stackable/jmx
132137
COPY --chown=${STACKABLE_USER_UID}:0 hive/stackable/jmx /stackable/jmx
133138
COPY --chown=${STACKABLE_USER_UID}:0 hive/stackable/bin/start-metastore /stackable/apache-hive-metastore-${PRODUCT}-bin/bin
@@ -150,6 +155,7 @@ chmod g=u /stackable/hive-metastore
150155
ln -s /stackable/hadoop-${HADOOP} /stackable/hadoop
151156
chown -h ${STACKABLE_USER_UID}:0 /stackable/hadoop
152157
chmod g=u /stackable/hadoop
158+
chmod g=u /stackable/*-src.tar.gz
153159

154160
# fix missing permissions
155161
chmod --recursive g=u /stackable/jmx

kafka-testing-tools/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ RUN microdnf install \
3030
&& rm -rf /var/cache/yum
3131

3232
# Store kcat version with binary name and add softlink
33-
COPY --chown=${STACKABLE_USER_UID}:0 --from=kcat /stackable/kcat-${KAFKA_KCAT}/kcat /stackable/kcat-${KAFKA_KCAT}
33+
COPY --chown=${STACKABLE_USER_UID}:0 --from=kcat /stackable/kcat /stackable/kcat-${KAFKA_KCAT}
34+
COPY --chown=${STACKABLE_USER_UID}:0 --from=kcat /stackable/kcat-${KAFKA_KCAT}-src.tar.gz /stackable
3435
RUN ln -s /stackable/kcat-${KAFKA_KCAT} /stackable/kcat
3536
COPY --chown=${STACKABLE_USER_UID}:0 --from=kcat /licenses /licenses
3637

kafka/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ COPY --chown=${STACKABLE_USER_UID}:0 kafka/stackable/patches/${PRODUCT} /stackab
2121
RUN <<EOF
2222
cd "$(/stackable/patchable --images-repo-root=src checkout kafka ${PRODUCT})"
2323

24+
# Create snapshot of the source code including custom patches
25+
tar -czf /stackable/kafka-${PRODUCT}-src.tar.gz .
26+
2427
# TODO: Try to install gradle via package manager (if possible) instead of fetching it from the internet
2528
# We don't specify "-x test" to skip the tests, as we might bump some Kafka internal dependencies in the future and
2629
# it's a good idea to run the tests in this case.
@@ -64,8 +67,10 @@ LABEL \
6467

6568
COPY --chown=${STACKABLE_USER_UID}:0 --from=kafka-builder /stackable/kafka_${SCALA}-${PRODUCT} /stackable/kafka_${SCALA}-${PRODUCT}
6669
COPY --chown=${STACKABLE_USER_UID}:0 --from=kafka-builder /stackable/kafka_${SCALA}-${PRODUCT}.cdx.json /stackable/kafka_${SCALA}-${PRODUCT}/kafka_${SCALA}-${PRODUCT}.cdx.json
70+
COPY --chown=${STACKABLE_USER_UID}:0 --from=kafka-builder /stackable/kafka-${PRODUCT}-src.tar.gz /stackable
6771
COPY --chown=${STACKABLE_USER_UID}:0 --from=kafka-builder /stackable/jmx/ /stackable/jmx/
68-
COPY --chown=${STACKABLE_USER_UID}:0 --from=kcat /stackable/kcat-${KAFKA_KCAT}/kcat /stackable/bin/kcat-${KAFKA_KCAT}
72+
COPY --chown=${STACKABLE_USER_UID}:0 --from=kcat /stackable/kcat /stackable/bin/kcat-${KAFKA_KCAT}
73+
COPY --chown=${STACKABLE_USER_UID}:0 --from=kcat /stackable/kcat-${KAFKA_KCAT}-src.tar.gz /stackable
6974
COPY --chown=${STACKABLE_USER_UID}:0 --from=kcat /licenses /licenses
7075

7176
COPY --chown=${STACKABLE_USER_UID}:0 kafka/licenses /licenses
@@ -96,6 +101,7 @@ chown -h ${STACKABLE_USER_UID}:0 /stackable/kafka
96101
chmod g=u /stackable/bin
97102
chmod g=u /stackable/jmx
98103
chmod g=u /stackable/kafka_${SCALA}-${PRODUCT}
104+
chmod g=u /stackable/*-src.tar.gz
99105
EOF
100106

101107
# ----------------------------------------

kafka/kcat/Dockerfile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Normally we would use stackable/image/stackable-base here, *but* we fail to link kcat at the end with error messages
55
# shown in Snippet 1, which we were not able to solve.
66

7-
FROM stackable/image/java-base AS builder
7+
FROM stackable/image/java-devel AS builder
88

99
ARG PRODUCT
1010
ARG STACKABLE_USER_UID
@@ -30,13 +30,20 @@ EOF
3030

3131
WORKDIR /stackable
3232

33+
COPY --chown=${STACKABLE_USER_UID}:0 kafka/kcat/stackable/patches/patchable.toml /stackable/src/kafka/kcat/stackable/patches/patchable.toml
34+
COPY --chown=${STACKABLE_USER_UID}:0 kafka/kcat/stackable/patches/${PRODUCT} /stackable/src/kafka/kcat/stackable/patches/${PRODUCT}
35+
3336
RUN <<EOF
34-
curl -O https://repo.stackable.tech/repository/packages/kcat/kcat-${PRODUCT}.tar.gz
35-
tar xvfz kcat-${PRODUCT}.tar.gz
36-
cd kcat-${PRODUCT}
37+
cd "$(/stackable/patchable --images-repo-root=src checkout kafka/kcat ${PRODUCT})"
38+
39+
# Create snapshot of the source code including custom patches
40+
tar -czf /stackable/kcat-${PRODUCT}-src.tar.gz .
41+
3742
./bootstrap.sh
43+
mv kcat /stackable/kcat
3844
# set correct permissions
39-
chmod --recursive g=u /stackable/kcat-${PRODUCT}
45+
chmod --recursive g=u /stackable/kcat
46+
chmod g=u /stackable/kcat-${PRODUCT}-src.tar.gz
4047
EOF
4148

4249
COPY --chown=${STACKABLE_USER_UID}:0 kafka/kcat/licenses /licenses
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
mirror = "https://github.com/stackabletech/kcat.git"
2+
base = "f2236ae5d985b9f31631b076df24ca6c33542e61"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
upstream = "https://github.com/edenhill/kcat.git"
2+
default-mirror = "https://github.com/stackabletech/kcat.git"

kafka/kcat/versions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
versions = [
22
{
33
"product": "1.7.0",
4-
"java-base": "11",
5-
"stackable-base": "1.0.0",
4+
"java-devel": "11",
5+
"stackable-devel": "1.0.0",
66
}
77
]

0 commit comments

Comments
 (0)