Skip to content

Commit c504a1e

Browse files
committed
Instrument some work for multi-version builds
1 parent f23c03e commit c504a1e

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

.github/workflows/build_docker.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ jobs:
2828
type=semver,prefix=base.,pattern={{major}}.{{minor}}
2929
type=raw,prefix=base.,value=edge,enable={{is_default_branch}}
3030
type=raw,prefix=base.,value=latest,enable=${{ github.event_name == 'release' }}
31+
32+
- name: Get major version
33+
id: major_version
34+
env:
35+
version: ${{ steps.meta.outputs.version }}
36+
run: |
37+
echo "major_version=${version%%.*}" >> "$GITHUB_OUTPUT"
3138
3239
- name: Set up QEMU
3340
uses: docker/setup-qemu-action@v3
@@ -50,6 +57,7 @@ jobs:
5057
with:
5158
file: ./Dockerfile.base
5259
build-args: |
60+
BASE_IMAGE_VERSION=${{ steps.major_version.outputs.version || bookworm-slim }}
5361
CI_DOCKER_VERSION=${{ steps.meta.outputs.version || github.sha }}
5462
push: ${{ github.event_name != 'pull_request' }}
5563
platforms: linux/amd64,linux/arm64

Dockerfile.base

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Build args
2+
ARG BASE_IMAGE_VERSION=bookworm-slim
23
ARG CI_DOCKER_VERSION
34

4-
FROM debian:bookworm-slim
5+
FROM debian:$BASE_IMAGE_VERSION
56
LABEL org.opencontainers.image.authors="Seth Parker <[email protected]>"
67
LABEL org.opencontainers.image.title="ci-docker (base)"
78
LABEL org.opencontainers.image.description="Base system packages"
@@ -14,11 +15,14 @@ ENV CI_DOCKER_VERSION=$CI_DOCKER_VERSION
1415
ENV LANG=en_US.UTF-8
1516
ENV LANGUAGE=en_US:en
1617
ENV LC_ALL=en_US.UTF-8
17-
ENV QT_PLUGIN_PATH=/usr/local/Qt-6.7.2/plugins
18+
ENV QT_PLUGIN_PATH=/usr/local/Qt-6.10.0/plugins
1819

1920
# Install apt sources
20-
RUN echo 'deb http://deb.debian.org/debian bookworm-backports main' > /etc/apt/sources.list.d/backports.list \
21-
&& apt-get clean && apt-get -y update
21+
RUN if [ "${BASE_IMAGE_VERSION}" = "bookworm-slim" ]; then \
22+
echo 'deb http://deb.debian.org/debian bookworm-backports main' > /etc/apt/sources.list.d/backports.list; \
23+
export BACKPORTS_TAG="-t bookworm-backports"
24+
fi \
25+
&& apt-get clean && apt-get -y update
2226
RUN apt-get install --fix-missing --fix-broken -y \
2327
build-essential \
2428
curl \
@@ -66,13 +70,13 @@ RUN apt-get install --fix-missing --fix-broken -y \
6670
zlib1g-dev \
6771
&& ln -s /usr/bin/python3 /usr/bin/python \
6872
&& sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen \
69-
&& apt-get -t bookworm-backports install -y cmake \
73+
&& apt-get ${BACKPORTS_TAG} install -y cmake \
7074
&& apt-get purge && rm -rf /var/lib/apt/lists/*
7175

7276
# Install Qt6
73-
RUN curl -O -L https://download.qt.io/archive/qt/6.7/6.7.2/single/qt-everywhere-src-6.7.2.tar.xz \
74-
&& tar -xf qt-everywhere-src-6.7.2.tar.xz \
75-
&& cd qt-everywhere-src-6.7.2/ \
77+
RUN curl -O -L https://download.qt.io/archive/qt/6.10/6.10.0/single/qt-everywhere-src-6.10.0.tar.xz \
78+
&& tar -xf qt-everywhere-src-6.10.0.tar.xz \
79+
&& cd qt-everywhere-src-6.10.0/ \
7680
&& ./configure -opensource -nomake examples -nomake tests -bundled-xcb-xinput -confirm-license \
7781
&& cmake --build . --parallel \
7882
&& cmake --install . \

build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ timestamp() {
66
date -u +'%Y-%m-%dT%H:%M:%SZ'
77
}
88

9+
BASE_IMAGE_VERSION=bookworm-slim
910
REPO=ghcr.io/educelab/ci-docker
1011
VER_MAJOR=12
1112
VER_MINOR=1
@@ -41,7 +42,7 @@ for TYPE in base dynamic static; do
4142
docker buildx build \
4243
-f Dockerfile.${TYPE} \
4344
--platform linux/amd64,linux/arm64 \
44-
--build-arg CI_DOCKER_VERSION=${VER_FULL} \
45+
--build-arg BASE_IMAGE_VERSION=${BASE_IMAGE_VERSION} CI_DOCKER_VERSION=${VER_FULL} \
4546
--provenance false \
4647
$(labels) \
4748
$(tags ${TYPE}) \

0 commit comments

Comments
 (0)