Skip to content

Commit 7e8969b

Browse files
committed
build(ct): move configbaker to Ubuntu 24.04 LTS
- Align image with the foundation of our usual app images. Enables reusing existing scripts to detect updates. - Move away from pinning all package versions. This won't work for most package systems, as older releases are only kept temporarily. We simply need to rely on detecting updates to them. - As Ubuntu Noble has no packages for awscli or wait4x, install them manually. - As awscli requires Python, install that and a rather lightweight package manager pipx. - Add SHELL specification to avoid any problems
1 parent b15681c commit 7e8969b

1 file changed

Lines changed: 45 additions & 34 deletions

File tree

modules/container-configbaker/Dockerfile

Lines changed: 45 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,50 +10,61 @@ ARG SOLR_VERSION
1010
FROM solr:${SOLR_VERSION} AS solr
1111

1212
# Let's build ourselves a baker
13-
FROM alpine:3.21
13+
FROM ubuntu:24.04
1414

1515
ENV SCRIPT_DIR="/scripts" \
1616
SECRETS_DIR="/secrets" \
1717
SOLR_TEMPLATE="/template"
1818
ENV PATH="${PATH}:${SCRIPT_DIR}" \
1919
BOOTSTRAP_DIR="${SCRIPT_DIR}/bootstrap"
2020

21-
# renovate: datasource=repology depName=alpine_3_21/aws-cli
22-
ENV AWS_CLI_VERSION="2.22.10-r0"
23-
# renovate: datasource=repology depName=alpine_3_21/bash
24-
ENV BASH_VERSION="5.2.37-r0"
25-
# renovate: datasource=repology depName=alpine_3_21/bind-tools
26-
ENV BIND_TOOLS_VERSION="9.18.36-r0"
27-
# renovate: datasource=repology depName=alpine_3_21/curl
28-
ENV CURL_VERSION="8.12.1-r1"
29-
# renovate: datasource=repology depName=alpine_3_21/dumb-init
30-
ENV DUMB_INIT_VERSION="1.2.5-r3"
31-
# renovate: datasource=repology depName=alpine_3_21/ed
32-
ENV ED_VERSION="1.20.2-r0"
33-
# renovate: datasource=repology depName=alpine_3_21/jq
34-
ENV JQ_VERSION="1.7.1-r0"
35-
# renovate: datasource=repology depName=alpine_3_21/netcat-openbsd
36-
ENV NETCAT_VERSION="1.226.1.1-r0"
37-
# renovate: datasource=repology depName=alpine_3_21/postgresql17-client
38-
ENV PGCLIENT17_VERSION="17.5-r0"
39-
# renovate: datasource=repology depName=alpine_3_21/wait4x
40-
ENV WAIT4X_VERSION="2.14.0-r9"
21+
ARG PKGS="curl dnsutils dumb-init ed jq netcat-openbsd postgresql-client"
22+
# renovate: datasource=github-releases depName=wait4x/wait4x
23+
ARG WAIT4X_VERSION="v3.3.0"
24+
# renovate: datasource=pypi depName=awscli
25+
ARG AWSCLI_VERSION="1.40.15"
26+
ARG PYTHON_PKGS="awscli==${AWSCLI_VERSION}"
27+
28+
# Auto-populated by BuildKit / buildx
29+
ARG TARGETARCH
30+
SHELL ["/bin/bash", "-eu", "-c"]
4131

4232
RUN true && \
43-
# Install necessary software and tools
44-
apk add --no-cache \
45-
aws-cli=${AWS_CLI_VERSION} \
46-
bind-tools=${BIND_TOOLS_VERSION} \
47-
bash=${BASH_VERSION} \
48-
curl=${CURL_VERSION} \
49-
dumb-init=${DUMB_INIT_VERSION} \
50-
ed=${ED_VERSION} \
51-
jq=${JQ_VERSION} \
52-
netcat-openbsd=${NETCAT_VERSION} \
53-
postgresql17-client=${PGCLIENT17_VERSION} \
54-
wait4x=${WAIT4X_VERSION} && \
5533
# Make our working directories
56-
mkdir -p ${SCRIPT_DIR} ${SECRETS_DIR} ${SOLR_TEMPLATE}
34+
mkdir -p ${SCRIPT_DIR} ${SECRETS_DIR} ${SOLR_TEMPLATE} && \
35+
36+
# Install packages
37+
apt-get update -q && \
38+
apt-get install -qqy --no-install-recommends ${PKGS} && \
39+
40+
# Workaround to install Python and pipx 1.5+ on Ubuntu 24.04 LTS: first install Python and pipx 1.4 \
41+
# Adapted from https://github.com/pypa/pipx/issues/1481#issuecomment-2593124603
42+
apt -qqy --no-install-recommends install python3 python3-venv pipx && \
43+
# Now install 1.5+ in ~/.local/bin/
44+
pipx install pipx && \
45+
# Remove 1.4 again
46+
apt purge -qqy --autoremove pipx && \
47+
# Install 1.5+ in /usr/local/bin/pipx
48+
~/.local/bin/pipx install --global pipx && \
49+
# Remove the virtual env install of pipx
50+
rm -rf "~/.local" && \
51+
52+
# Cleanup apt cache
53+
rm -rf "/var/lib/apt/lists/*"
54+
55+
# New step (and shell) as this is a different manager and we need pipx around as command
56+
RUN true && \
57+
# Install things not available as packages \
58+
ARCH="${TARGETARCH:-$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')}" && \
59+
60+
# 1. wait4x \
61+
curl -sSfL -o /usr/bin/wait4x.tar.gz "https://github.com/wait4x/wait4x/releases/download/${WAIT4X_VERSION}/wait4x-linux-${ARCH}.tar.gz" && \
62+
curl -sSfL -o /tmp/w4x-checksum "https://github.com/wait4x/wait4x/releases/download/${WAIT4X_VERSION}/wait4x-linux-${ARCH}.tar.gz.sha256sum" && \
63+
echo "$(cat /tmp/w4x-checksum | cut -f1 -d" ") /usr/bin/wait4x.tar.gz" | sha256sum -c - && \
64+
tar -xzf /usr/bin/wait4x.tar.gz -C /usr/bin && chmod +x /usr/bin/wait4x && \
65+
66+
# 2. Python packages
67+
pipx install --global ${PYTHON_PKGS}
5768

5869
# Get in the scripts
5970
COPY maven/scripts maven/solr/update-fields.sh ${SCRIPT_DIR}/

0 commit comments

Comments
 (0)