Skip to content

Commit bdc6dfd

Browse files
committed
feat: introduce stackable-devel image
1 parent 75f8990 commit bdc6dfd

File tree

7 files changed

+108
-67
lines changed

7 files changed

+108
-67
lines changed

conf.py

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
opa = importlib.import_module("opa.versions")
2727
spark_k8s = importlib.import_module("spark-k8s.versions")
2828
stackable_base = importlib.import_module("stackable-base.versions")
29+
stackable_devel = importlib.import_module("stackable-devel.versions")
2930
superset = importlib.import_module("superset.versions")
3031
trino_cli = importlib.import_module("trino-cli.versions")
3132
trino = importlib.import_module("trino.versions")
@@ -54,6 +55,7 @@
5455
{"name": "opa", "versions": opa.versions},
5556
{"name": "spark-k8s", "versions": spark_k8s.versions},
5657
{"name": "stackable-base", "versions": stackable_base.versions},
58+
{"name": "stackable-devel", "versions": stackable_devel.versions},
5759
{"name": "superset", "versions": superset.versions},
5860
{"name": "trino-cli", "versions": trino_cli.versions},
5961
{"name": "trino", "versions": trino.versions},

java-devel/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# check=error=true
33

44
#
5-
# Base imaege for builder stages
5+
# Base image for builder stages in Java based products
66
#
77

8-
FROM stackable/image/stackable-base
8+
FROM stackable/image/stackable-devel
99

1010
ARG PRODUCT
1111

java-devel/versions.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
versions = [
22
{
33
"product": "8",
4-
"stackable-base": "1.0.0",
4+
"stackable-devel": "1.0.0",
55
},
66
{
77
"product": "11",
8-
"stackable-base": "1.0.0",
8+
"stackable-devel": "1.0.0",
99
},
1010
{
1111
"product": "17",
12-
"stackable-base": "1.0.0",
12+
"stackable-devel": "1.0.0",
1313
},
1414
{
1515
"product": "21",
16-
"stackable-base": "1.0.0",
16+
"stackable-devel": "1.0.0",
1717
},
1818
{
1919
"product": "22",
20-
"stackable-base": "1.0.0",
20+
"stackable-devel": "1.0.0",
2121
},
2222
{
2323
"product": "23",
24-
"stackable-base": "1.0.0",
24+
"stackable-devel": "1.0.0",
2525
},
2626
]

stackable-base/Dockerfile

+6-59
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,32 @@
11
# syntax=docker/dockerfile:1.10.0@sha256:865e5dd094beca432e8c0a1d5e1c465db5f998dca4e439981029b3b81fb39ed5
22
# check=error=true
33

4-
# Find the latest version at https://catalog.redhat.com/software/containers/ubi9/ubi-minimal/615bd9b4075b022acc111bf5?container-tabs=gti
5-
# IMPORTANT: Make sure to use the "Manifest List Digest" that references the images for multiple architectures
6-
# rather than just the "Image Digest" that references the image for the selected architecture.
7-
FROM registry.access.redhat.com/ubi9/ubi-minimal@sha256:c0e70387664f30cd9cf2795b547e4a9a51002c44a4a86aa9335ab030134bf392 AS product-utils-builder
4+
FROM stackable/image/stackable-devel AS config-utils
85

96
# Find the latest version here: https://github.com/stackabletech/config-utils/tags
107
# renovate: datasource=github-tags packageName=stackabletech/config-utils
118
ENV CONFIG_UTILS_VERSION=0.2.0
12-
# Find the latest version here: https://github.com/stackabletech/containerdebug/tags
13-
# renovate: datasource=github-tags packageName=stackabletech/containerdebug
14-
ENV CONTAINERDEBUG_VERSION=0.1.1
15-
# This SHOULD be kept in sync with operator-templating and other tools to reduce build times
16-
# Find the latest version here: https://doc.rust-lang.org/stable/releases.html
17-
# renovate: datasource=github-releases packageName=rust-lang/rust
18-
ENV RUST_DEFAULT_TOOLCHAIN_VERSION=1.84.1
19-
# Find the latest version here: https://crates.io/crates/cargo-cyclonedx
20-
# renovate: datasource=crate packageName=cargo-cyclonedx
21-
ENV CARGO_CYCLONEDX_CRATE_VERSION=0.5.7
22-
# Find the latest version here: https://crates.io/crates/cargo-auditable
23-
# renovate: datasource=crate packageName=cargo-auditable
24-
ENV CARGO_AUDITABLE_CRATE_VERSION=0.6.6
25-
26-
RUN <<EOF
27-
microdnf update --assumeyes
28-
29-
# git: Needed to fetch source
30-
# gcc: Needed for compilation
31-
microdnf --assumeyes install \
32-
gcc \
33-
git
34-
microdnf clean all
35-
rm -rf /var/cache/yum
36-
37-
# WARNING (@NickLarsenNZ): We should pin the rustup version
38-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain "$RUST_DEFAULT_TOOLCHAIN_VERSION"
39-
. "$HOME/.cargo/env" && cargo --quiet install cargo-cyclonedx@"$CARGO_CYCLONEDX_CRATE_VERSION" cargo-auditable@"$CARGO_AUDITABLE_CRATE_VERSION"
40-
EOF
41-
42-
FROM product-utils-builder AS config-utils
439

4410
RUN <<EOF
4511
git clone --depth 1 --branch "${CONFIG_UTILS_VERSION}" https://github.com/stackabletech/config-utils
4612
cd ./config-utils
4713
. "$HOME/.cargo/env"
48-
rustup toolchain install
4914
cargo auditable --quiet build --release && cargo cyclonedx --all --spec-version 1.5 --describe binaries
5015
EOF
5116

52-
FROM product-utils-builder AS containerdebug
17+
FROM stackable/image/stackable-devel AS containerdebug
18+
19+
# Find the latest version here: https://github.com/stackabletech/containerdebug/tags
20+
# renovate: datasource=github-tags packageName=stackabletech/containerdebug
21+
ENV CONTAINERDEBUG_VERSION=0.1.1
5322

5423
RUN <<EOF
5524
git clone --depth 1 --branch "${CONTAINERDEBUG_VERSION}" https://github.com/stackabletech/containerdebug
5625
cd ./containerdebug
5726
. "$HOME/.cargo/env"
58-
rustup toolchain install
5927
cargo auditable --quiet build --release && cargo cyclonedx --all --spec-version 1.5 --describe binaries
6028
EOF
6129

62-
FROM product-utils-builder AS patchable
63-
64-
# Copy source code of patchable
65-
COPY rust/patchable/ /patchable/rust/patchable
66-
# Copy workspace files
67-
COPY Cargo.* /patchable/
68-
69-
RUN <<EOF
70-
microdnf update --assumeyes
71-
microdnf install --assumeyes openssl-devel pkg-config
72-
cd /patchable
73-
. "$HOME/.cargo/env"
74-
rustup toolchain install
75-
cargo auditable --quiet build --release && cargo cyclonedx --all --spec-version 1.5 --describe binaries
76-
microdnf clean all
77-
EOF
78-
7930
# Find the latest version at https://catalog.redhat.com/software/containers/ubi9/ubi-minimal/615bd9b4075b022acc111bf5?container-tabs=gti
8031
# IMPORTANT: Make sure to use the "Manifest List Digest" that references the images for multiple architectures
8132
# rather than just the "Image Digest" that references the image for the selected architecture.
@@ -221,10 +172,6 @@ COPY --from=config-utils --chown=${STACKABLE_USER_UID}:0 /config-utils/config-ut
221172
# Debug tool that logs generic system information.
222173
COPY --from=containerdebug --chown=${STACKABLE_USER_UID}:0 /containerdebug/target/release/containerdebug /stackable/containerdebug
223174

224-
# **patchable**
225-
# Tool for patch management
226-
COPY --from=patchable --chown=${STACKABLE_USER_UID}:0 /patchable/target/release/patchable /stackable/patchable
227-
228175
ENV PATH="${PATH}:/stackable"
229176

230177
# These labels have mostly been superceded by the OpenContainer spec annotations below but it doesn't hurt to include them

stackable-base/versions.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
versions = [
22
{
33
"product": "1.0.0",
4+
"stackable-devel": "1.0.0",
45
},
56
]

stackable-devel/Dockerfile

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# syntax=docker/dockerfile:1.10.0@sha256:865e5dd094beca432e8c0a1d5e1c465db5f998dca4e439981029b3b81fb39ed5
2+
# check=error=true
3+
4+
#
5+
# Base image for builder stages
6+
#
7+
8+
# Find the latest version at https://catalog.redhat.com/software/containers/ubi9/ubi-minimal/615bd9b4075b022acc111bf5?container-tabs=gti
9+
# IMPORTANT: Make sure to use the "Manifest List Digest" that references the images for multiple architectures
10+
# rather than just the "Image Digest" that references the image for the selected architecture.
11+
FROM registry.access.redhat.com/ubi9/ubi-minimal@sha256:c0e70387664f30cd9cf2795b547e4a9a51002c44a4a86aa9335ab030134bf392
12+
13+
# intentionally unused
14+
ARG PRODUCT
15+
ARG STACKABLE_USER_UID
16+
ARG STACKABLE_USER_GID
17+
ARG STACKABLE_USER_NAME
18+
19+
# This SHOULD be kept in sync with operator-templating and other tools to reduce build times
20+
# Find the latest version here: https://doc.rust-lang.org/stable/releases.html
21+
# renovate: datasource=github-releases packageName=rust-lang/rust
22+
ENV RUST_DEFAULT_TOOLCHAIN_VERSION=1.84.1
23+
# Find the latest version here: https://crates.io/crates/cargo-cyclonedx
24+
# renovate: datasource=crate packageName=cargo-cyclonedx
25+
ENV CARGO_CYCLONEDX_CRATE_VERSION=0.5.7
26+
# Find the latest version here: https://crates.io/crates/cargo-auditable
27+
# renovate: datasource=crate packageName=cargo-auditable
28+
ENV CARGO_AUDITABLE_CRATE_VERSION=0.6.6
29+
30+
RUN <<EOF
31+
microdnf update --assumeyes
32+
33+
# git: Needed to fetch source
34+
# gcc: Needed for compilation
35+
microdnf --assumeyes install \
36+
gcc \
37+
git
38+
39+
###
40+
### Add Stackable user and group
41+
###
42+
# Added only temporarily to create the user and group, removed again below
43+
microdnf --assumeyes install shadow-utils
44+
groupadd --gid ${STACKABLE_USER_GID} --system ${STACKABLE_USER_NAME}
45+
46+
# The --no-log-init is required to work around a bug/problem in Go/Docker when very large UIDs are used
47+
# See https://github.com/moby/moby/issues/5419#issuecomment-41478290 for more context
48+
# Making this a system user prevents a mail dir from being created, expiry of passwords etc. but it will warn:
49+
# useradd warning: stackable's uid 1000 is greater than SYS_UID_MAX 999
50+
# We can safely ignore this warning, to get rid of the warning we could change /etc/login.defs but that does not seem worth it
51+
# We'll leave the home directory hardcoded to /stackable because I don't want to deal with which chars might be valid and which might not in user name vs. directory
52+
useradd \
53+
--no-log-init \
54+
--gid ${STACKABLE_USER_GID} \
55+
--uid ${STACKABLE_USER_UID} \
56+
--system \
57+
--create-home \
58+
--home-dir /stackable \
59+
${STACKABLE_USER_NAME}
60+
microdnf --assumeyes remove shadow-utils
61+
62+
microdnf clean all
63+
rm -rf /var/cache/yum
64+
65+
# WARNING (@NickLarsenNZ): We should pin the rustup version
66+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain "$RUST_DEFAULT_TOOLCHAIN_VERSION"
67+
. "$HOME/.cargo/env" && cargo --quiet install cargo-cyclonedx@"$CARGO_CYCLONEDX_CRATE_VERSION" cargo-auditable@"$CARGO_AUDITABLE_CRATE_VERSION" && rustup toolchain install
68+
EOF
69+
70+
71+
# **patchable**
72+
# Tool for patch management
73+
# Copy source code of patchable
74+
COPY rust/patchable/ /patchable/rust/patchable
75+
# Copy workspace files
76+
COPY Cargo.* /patchable/
77+
78+
RUN <<EOF
79+
microdnf update --assumeyes
80+
microdnf install --assumeyes openssl-devel pkg-config
81+
cd /patchable
82+
. "$HOME/.cargo/env"
83+
cargo auditable --quiet build --release && cargo cyclonedx --all --spec-version 1.5 --describe binaries
84+
mv /patchable/target/release/patchable /stackable/patchable
85+
microdnf clean all
86+
EOF

stackable-devel/versions.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
versions = [
2+
{
3+
"product": "1.0.0",
4+
},
5+
]

0 commit comments

Comments
 (0)