Skip to content

Commit a0bf234

Browse files
committed
Build discourse/base and discourse/discourse_test image for bookworm
We need to upgrade to bookworm because bullseye is EOL.
1 parent 6f7f62c commit a0bf234

File tree

4 files changed

+114
-12
lines changed

4 files changed

+114
-12
lines changed

.github/workflows/build.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,51 @@ jobs:
104104
run: |
105105
docker tag discourse/base:release${{ steps.arch-helper.outputs.arch_postfix_dash }} discourse/base:aarch64
106106
docker push discourse/base:aarch64
107+
base_bookworm:
108+
runs-on: ubuntu-20.04${{ ((github.event_name != 'schedule') && '-8core') || '' }}
109+
timeout-minutes: ${{ github.event_name != 'schedule' && 30 }}
110+
steps:
111+
- uses: actions/checkout@v3
112+
with:
113+
fetch-depth: 1
114+
- name: build slim image
115+
run: |
116+
cd image && ruby auto_build.rb base_slim_bookworm
117+
- name: tag slim images
118+
id: tag-images
119+
run: |
120+
TAG=`date +%Y%m%d-%H%M`
121+
echo "tag=$(echo $TAG)" >> $GITHUB_OUTPUT
122+
docker tag discourse/base:build_slim_bookworm discourse/base:2.0.$TAG-slim-bookworm
123+
docker tag discourse/base:build_slim_bookworm discourse/base:slim-bookworm
124+
- name: build release image
125+
run: |
126+
cd image && ruby auto_build.rb base_bookworm
127+
- name: tag release images
128+
run: |
129+
TAG=${{ steps.tag-images.outputs.tag }}
130+
docker tag discourse/base:build_bookworm discourse/base:2.0.$TAG-bookworm
131+
docker tag discourse/base:build_bookworm discourse/base:release-bookworm
132+
- name: build test_build image
133+
run: |
134+
cd image && ruby auto_build.rb discourse_test_build_bookworm
135+
- name: run specs
136+
run: |
137+
docker run --rm -e RUBY_ONLY=1 -e USE_TURBO=1 -e SKIP_PLUGINS=1 -e SKIP_LINT=1 discourse/discourse_test:build_bookworm
138+
- name: Print summary
139+
run: |
140+
docker images discourse/base
141+
- name: push to dockerhub
142+
if: success() && (github.ref == 'refs/heads/main')
143+
env:
144+
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
145+
run: |
146+
TAG=${{ steps.tag-images.outputs.tag }}
147+
docker login --username discoursebuild --password $DOCKERHUB_PASSWORD
148+
docker push discourse/base:2.0.$TAG-slim-bookworm
149+
docker push discourse/base:slim-bookworm
150+
docker push discourse/base:2.0.$TAG-bookworm
151+
docker push discourse/base:release-bookworm
107152
test:
108153
runs-on: ubuntu-20.04${{ ((github.event_name != 'schedule') && '-8core') || '' }}
109154
timeout-minutes: 30
@@ -145,6 +190,47 @@ jobs:
145190
docker push discourse/discourse_test:slim
146191
docker push discourse/discourse_test:slim-browsers
147192
docker push discourse/discourse_test:release
193+
test_bookworm:
194+
runs-on: ubuntu-20.04${{ ((github.event_name != 'schedule') && '-8core') || '' }}
195+
timeout-minutes: 30
196+
needs: base
197+
defaults:
198+
run:
199+
working-directory: image/discourse_test
200+
steps:
201+
- uses: actions/checkout@v3
202+
with:
203+
fetch-depth: 1
204+
- name: build discourse_test:slim-bookworm
205+
run: |
206+
docker buildx build . --load \
207+
--build-arg from_tag=slim-bookworm \
208+
--target base \
209+
--tag discourse/discourse_test:slim-bookworm
210+
- name: build discourse_test:slim-browsers-bookworm
211+
run: |
212+
docker buildx build . --load \
213+
--build-arg from_tag=slim-bookworm \
214+
--target with_browsers \
215+
--tag discourse/discourse_test:slim-browsers-bookworm
216+
- name: build discourse_test:release-bookworm
217+
run: |
218+
docker buildx build . --load \
219+
--build-arg from_tag=release-bookworm \
220+
--target release \
221+
--tag discourse/discourse_test:release-bookworm
222+
- name: Print summary
223+
run: |
224+
docker images discourse/discourse_test
225+
- name: push to dockerhub
226+
if: success() && (github.ref == 'refs/heads/main')
227+
env:
228+
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
229+
run: |
230+
docker login --username discoursebuild --password $DOCKERHUB_PASSWORD
231+
docker push discourse/discourse_test:slim-bookworm
232+
docker push discourse/discourse_test:slim-browsers-bookworm
233+
docker push discourse/discourse_test:release-bookworm
148234
dev:
149235
runs-on: ubuntu-20.04${{ ((github.event_name != 'schedule') && '-8core') || '' }}
150236
timeout-minutes: 30

image/auto_build.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
tag: "discourse/base:build_slim",
1010
extra_args: "-f slim.Dockerfile",
1111
},
12+
base_slim_bookworm: {
13+
name: "base",
14+
tag: "discourse/base:build_slim_bookworm",
15+
extra_args: "-f slim.Dockerfile --build-arg=\"DEBIAN_RELEASE=bookworm\"",
16+
},
1217
base_slim_arm64: {
1318
name: "base",
1419
tag: "discourse/base:build_slim_arm64",
@@ -19,6 +24,11 @@
1924
tag: "discourse/base:build",
2025
extra_args: "-f release.Dockerfile",
2126
},
27+
base_bookworm: {
28+
name: "base",
29+
tag: "discourse/base:build_bookworm",
30+
extra_args: "-f release.Dockerfile --build-arg=\"tag=build_slim_bookworm\"",
31+
},
2232
base_arm64: {
2333
name: "base",
2434
tag: "discourse/base:build_arm64",
@@ -28,6 +38,11 @@
2838
name: "discourse_test",
2939
tag: "discourse/discourse_test:build",
3040
},
41+
discourse_test_build_bookworm: {
42+
name: "discourse_test",
43+
tag: "discourse/discourse_test:build_bookworm",
44+
extra_args: "--build-arg=\"from_tag=build_bookworm\"",
45+
},
3146
discourse_test_build_arm64: {
3247
name: "discourse_test",
3348
tag: "discourse/discourse_test:build_arm64",

image/base/install-imagemagick

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ IMAGE_MAGICK_HASH="d282117bc6d0e91ad1ad685d096623b96ed8e229f911c891d83277b350ef8
99
LIBJPEGTURBO=$(cat /etc/issue | grep -qi Debian && echo 'libjpeg62-turbo libjpeg62-turbo-dev' || echo 'libjpeg-turbo8 libjpeg-turbo8-dev')
1010

1111
# Ubuntu 22.04/22.10 doesn't have libwebp6
12-
LIBWEBP=$(cat /etc/issue | grep -qi 'Ubuntu 22' && echo 'libwebp7' || echo 'libwebp6')
12+
LIBWEBP=$(cat /etc/issue | grep -qiE 'Debian GNU/Linux 12|Ubuntu 22' && echo 'libwebp7' || echo 'libwebp6')
1313

1414
PREFIX=/usr/local
1515
WDIR=/tmp/imagemagick
1616

1717
# Install build deps
1818
apt -y -q remove imagemagick
1919
apt -y -q install git make gcc pkg-config autoconf curl g++ yasm cmake \
20-
libde265-0 libde265-dev ${LIBJPEGTURBO} x265 libx265-dev libtool \
21-
libpng16-16 libpng-dev ${LIBJPEGTURBO} ${LIBWEBP} libwebp-dev libgomp1 \
20+
libde265-0 libde265-dev ${LIBJPEGTURBO} ${LIBWEBP} x265 libx265-dev libtool \
21+
libpng16-16 libpng-dev libwebp-dev libgomp1 \
2222
libwebpmux3 libwebpdemux2 ghostscript libxml2-dev libxml2-utils librsvg2-dev \
23-
libltdl7-dev libbz2-dev gsfonts libtiff-dev libfreetype6-dev libjpeg-dev
23+
libltdl7-dev libbz2-dev gsfonts libtiff-dev libfreetype6-dev libjpeg-dev libheif1 libheif-dev
2424

25-
# Ubuntu doesn't like `bullseye-backports`
26-
if cat /etc/issue | grep -qi 'Ubuntu 22'; then
27-
apt -y install libheif1 libaom-dev libheif-dev
25+
# Ubuntu doesn't like backports
26+
if cat /etc/issue | grep -qiE 'Debian GNU/Linux 12|Ubuntu 22'; then
27+
apt -y install libaom-dev
2828
else
2929
# Use backports instead of compiling it
30-
apt -y -q install -t bullseye-backports libheif1 libaom-dev libheif-dev
30+
apt -y -q install -t bullseye-backports libaom-dev
3131
fi
3232

3333
mkdir -p $WDIR

image/base/slim.Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ENV PG_MAJOR=13 \
1919

2020
RUN echo 2.0.`date +%Y%m%d` > /VERSION
2121

22-
RUN echo 'deb http://deb.debian.org/debian bullseye-backports main' > /etc/apt/sources.list.d/bullseye-backports.list
22+
RUN echo "deb http://deb.debian.org/debian ${DEBIAN_RELEASE}-backports main" > "/etc/apt/sources.list.d/${DEBIAN_RELEASE}-backports.list"
2323
RUN echo "debconf debconf/frontend select Teletype" | debconf-set-selections
2424
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install gnupg sudo curl fping
2525
RUN sh -c "fping proxy && echo 'Acquire { Retries \"0\"; HTTP { Proxy \"http://proxy:3128\";}; };' > /etc/apt/apt.conf.d/40proxy && apt-get update || true"
@@ -31,9 +31,10 @@ ENV LC_ALL en_US.UTF-8
3131
ENV LANG en_US.UTF-8
3232
ENV LANGUAGE en_US.UTF-8
3333

34-
RUN curl https://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | apt-key add -
35-
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" | \
36-
tee /etc/apt/sources.list.d/postgres.list
34+
RUN install -d /usr/share/postgresql-common/pgdg &&\
35+
curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc &&\
36+
echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt ${DEBIAN_RELEASE}-pgdg main" > /etc/apt/sources.list.d/pgdg.list
37+
3738
RUN curl --silent --location https://deb.nodesource.com/setup_18.x | sudo bash -
3839
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
3940
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list

0 commit comments

Comments
 (0)