From 7aeefa70965d1c4e78c1f02b947dcb713703bf59 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 15 Oct 2024 11:25:28 +0200 Subject: [PATCH 01/13] Bookworm: first draft --- 3.5/bookworm/Dockerfile | 93 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 3.5/bookworm/Dockerfile diff --git a/3.5/bookworm/Dockerfile b/3.5/bookworm/Dockerfile new file mode 100644 index 0000000..e436d2e --- /dev/null +++ b/3.5/bookworm/Dockerfile @@ -0,0 +1,93 @@ +# Base ################################################################## +FROM debian:bookworm AS debian-minimal +ARG PANDOC=3.5 +ARG LUA=5.4 + +LABEL maintainer='Albert Krewinkel ' +LABEL org.pandoc.maintainer='Albert Krewinkel ' +LABEL org.pandoc.author "John MacFarlane" +LABEL org.pandoc.version "$pandoc_version" + +# Install runtime dependencies +RUN < cabal.project +# Add pandoc-crossref to project +printf 'extra-packages: pandoc-crossref\n' >> cabal.project +cat cabal.project +EOF + +RUN < Date: Tue, 15 Oct 2024 11:38:38 +0200 Subject: [PATCH 02/13] Use cabal install --- 3.5/bookworm/Dockerfile | 38 +++++--------------------------------- 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/3.5/bookworm/Dockerfile b/3.5/bookworm/Dockerfile index e436d2e..82509fa 100644 --- a/3.5/bookworm/Dockerfile +++ b/3.5/bookworm/Dockerfile @@ -44,50 +44,22 @@ apt-get install --assume-yes --no-install-recommends \ zlib1g-dev EOF -RUN < cabal.project -# Add pandoc-crossref to project -printf 'extra-packages: pandoc-crossref\n' >> cabal.project -cat cabal.project -EOF - -RUN < Date: Thu, 17 Oct 2024 12:13:44 +0200 Subject: [PATCH 03/13] Do everything in one RUN --- 3.5/bookworm/Dockerfile | 397 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 369 insertions(+), 28 deletions(-) diff --git a/3.5/bookworm/Dockerfile b/3.5/bookworm/Dockerfile index 82509fa..67328f4 100644 --- a/3.5/bookworm/Dockerfile +++ b/3.5/bookworm/Dockerfile @@ -24,42 +24,383 @@ apt-get install --assume-yes --no-install-recommends \ rm -rf /var/lib/apt/lists/* EOF -RUN < /dev/null; \ + [ -z "$manually_installed" ] || apt-mark manual $manually_installed; \ + apt-get purge -y --auto-remove \ + -o APT::AutoRemove::RecommendsImportant=false; \ -# cd / -# ls -l -d /root/.* -# rm -rf /root/.cabal /root/.ghc -# rm -rf /tmp/* -# rm -rf /var/lib/apt/lists/* From 349d0791c63359b5d1ae85187cb4ef851ea46f95 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 17 Oct 2024 12:15:16 +0200 Subject: [PATCH 04/13] CI: Disable build --- .github/workflows/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 39dc6d8..9fe726d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -20,6 +20,7 @@ on: jobs: configure: + if: false name: Configure runs-on: ubuntu-latest outputs: From 45ec1ea5467cd66e4f4301762ca5aa0c67262fbc Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 17 Oct 2024 12:30:27 +0200 Subject: [PATCH 05/13] Add experimental GitHub Action --- .github/workflows/debian.yaml | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/debian.yaml diff --git a/.github/workflows/debian.yaml b/.github/workflows/debian.yaml new file mode 100644 index 0000000..22f0bbd --- /dev/null +++ b/.github/workflows/debian.yaml @@ -0,0 +1,48 @@ +name: Image Builder + +on: + push: + paths: + - 'debian/*' + - 'versions.md' + - 'LICENSE' + - '**/bookworm/*' + pull_request: + # Build, but don't push on pull requests + +jobs: + build: + name: Build + runs-on: ubuntu-latest + needs: configure + + strategy: + fail-fast: false + matrix: + stack: ${{ fromJSON( needs.configure.outputs.stacks ) }} + version: ${{ fromJSON( needs.configure.outputs.pandoc-version ) }} + + env: + PUSH_IMAGE: ${{ github.repository == 'pandoc/dockerfiles' && + (github.ref == 'refs/heads/main' || + github.ref_type == 'tag' || + github.event_name != 'pull_request') }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + if: ${{ env.PUSH_IMAGE }} + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + + - name: Build and maybe push image + uses: docker/build-push-action@v5 + with: + file: '3.5/bookworm/Dockerfile' + context: '.' + push: ${{ env.PUSH_IMAGE }} + tags: '3.5-debian' From a6c88b710f6263777984d9e6c0410b73e2c9b792 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 17 Oct 2024 12:33:48 +0200 Subject: [PATCH 06/13] Run debian CI independently of the paths changed --- .github/workflows/debian.yaml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/debian.yaml b/.github/workflows/debian.yaml index 22f0bbd..baaecae 100644 --- a/.github/workflows/debian.yaml +++ b/.github/workflows/debian.yaml @@ -2,11 +2,6 @@ name: Image Builder on: push: - paths: - - 'debian/*' - - 'versions.md' - - 'LICENSE' - - '**/bookworm/*' pull_request: # Build, but don't push on pull requests @@ -14,13 +9,6 @@ jobs: build: name: Build runs-on: ubuntu-latest - needs: configure - - strategy: - fail-fast: false - matrix: - stack: ${{ fromJSON( needs.configure.outputs.stacks ) }} - version: ${{ fromJSON( needs.configure.outputs.pandoc-version ) }} env: PUSH_IMAGE: ${{ github.repository == 'pandoc/dockerfiles' && From 24cb4920e36b3ef23dea3d596566595e1974a969 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 17 Oct 2024 13:15:33 +0200 Subject: [PATCH 07/13] Build amd64 and arm64 images --- .github/workflows/debian.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/debian.yaml b/.github/workflows/debian.yaml index baaecae..718a71d 100644 --- a/.github/workflows/debian.yaml +++ b/.github/workflows/debian.yaml @@ -20,6 +20,12 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to Docker Hub uses: docker/login-action@v3 if: ${{ env.PUSH_IMAGE }} @@ -32,5 +38,6 @@ jobs: with: file: '3.5/bookworm/Dockerfile' context: '.' + platforms: linux/amd64,linux/arm64/v8 push: ${{ env.PUSH_IMAGE }} - tags: '3.5-debian' + tags: 'pandoc/core:3.5-debian' From 768ea1b6cbff32ba1ddd8720bd7cf4d5ae04b9d5 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 17 Oct 2024 18:29:50 +0200 Subject: [PATCH 08/13] Remove constraint 'bytestring -pure-haskell' --- 3.5/bookworm/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/3.5/bookworm/Dockerfile b/3.5/bookworm/Dockerfile index 67328f4..45ef184 100644 --- a/3.5/bookworm/Dockerfile +++ b/3.5/bookworm/Dockerfile @@ -109,7 +109,6 @@ RUN set -eux; \ --constraint='any.bsb-http-chunked ==0.0.0.4' \ --constraint='any.byteorder ==1.0.4' \ --constraint='any.bytestring ==0.10.12.1 || ==0.12.1.0' \ - --constraint='bytestring -pure-haskell' \ --constraint='any.cabal-doctest ==1.0.10' \ --constraint='any.call-stack ==0.4.0' \ --constraint='any.case-insensitive ==1.2.1.0' \ From 52296db8e57aa441bea814076e5d6126fb35494e Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 17 Oct 2024 19:10:27 +0200 Subject: [PATCH 09/13] Use different bytestring version --- 3.5/bookworm/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3.5/bookworm/Dockerfile b/3.5/bookworm/Dockerfile index 45ef184..973347d 100644 --- a/3.5/bookworm/Dockerfile +++ b/3.5/bookworm/Dockerfile @@ -108,7 +108,7 @@ RUN set -eux; \ --constraint='boring +tagged' \ --constraint='any.bsb-http-chunked ==0.0.0.4' \ --constraint='any.byteorder ==1.0.4' \ - --constraint='any.bytestring ==0.10.12.1 || ==0.12.1.0' \ + --constraint='any.bytestring ==0.10.12.1 || ==0.12.0.2' \ --constraint='any.cabal-doctest ==1.0.10' \ --constraint='any.call-stack ==0.4.0' \ --constraint='any.case-insensitive ==1.2.1.0' \ From 13a162164d2f891996e7117f556520027d5efcfc Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 18 Oct 2024 10:37:00 +0200 Subject: [PATCH 10/13] Adjust GHC options --- 3.5/bookworm/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3.5/bookworm/Dockerfile b/3.5/bookworm/Dockerfile index 973347d..b793434 100644 --- a/3.5/bookworm/Dockerfile +++ b/3.5/bookworm/Dockerfile @@ -57,7 +57,7 @@ RUN set -eux; \ --prefix=/usr/local \ --flags='+server +lua' \ --sysconfdir=/etc \ - --ghc-options='-O1 -optc-Os -optl=-pthread -fPIC -j +RTS -A128m -n2m -RTS' \ + --ghc-options='-optc-Os -optl=-pthread -fPIC -j +RTS -A256m -RTS' \ --constraint='any.Cabal ==3.4.1.0' \ --constraint='any.Glob ==0.10.2' \ --constraint='any.HUnit ==1.6.2.0' \ From a13f26a786c6abaed26c523bbc3957f30c366ea3 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 18 Oct 2024 10:37:55 +0200 Subject: [PATCH 11/13] Build arm64 only --- .github/workflows/debian.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/debian.yaml b/.github/workflows/debian.yaml index 718a71d..ebdf196 100644 --- a/.github/workflows/debian.yaml +++ b/.github/workflows/debian.yaml @@ -7,7 +7,7 @@ on: jobs: build: - name: Build + name: Debian runs-on: ubuntu-latest env: @@ -38,6 +38,6 @@ jobs: with: file: '3.5/bookworm/Dockerfile' context: '.' - platforms: linux/amd64,linux/arm64/v8 + platforms: linux/arm64/v8 push: ${{ env.PUSH_IMAGE }} tags: 'pandoc/core:3.5-debian' From c4dbb658ed8c1e60ef612e3d43b172a8354ef3d3 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 18 Oct 2024 11:02:16 +0200 Subject: [PATCH 12/13] Let GHC use four cores --- 3.5/bookworm/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3.5/bookworm/Dockerfile b/3.5/bookworm/Dockerfile index b793434..6d20bb3 100644 --- a/3.5/bookworm/Dockerfile +++ b/3.5/bookworm/Dockerfile @@ -57,7 +57,7 @@ RUN set -eux; \ --prefix=/usr/local \ --flags='+server +lua' \ --sysconfdir=/etc \ - --ghc-options='-optc-Os -optl=-pthread -fPIC -j +RTS -A256m -RTS' \ + --ghc-options='-optc-Os -optl=-pthread -fPIC -j4 +RTS -A256m -RTS' \ --constraint='any.Cabal ==3.4.1.0' \ --constraint='any.Glob ==0.10.2' \ --constraint='any.HUnit ==1.6.2.0' \ From e542f33490d4848f7421751d54d74dce870c39a2 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 18 Oct 2024 11:19:18 +0200 Subject: [PATCH 13/13] Set GHC's heap to 4G --- 3.5/bookworm/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3.5/bookworm/Dockerfile b/3.5/bookworm/Dockerfile index 6d20bb3..080da5e 100644 --- a/3.5/bookworm/Dockerfile +++ b/3.5/bookworm/Dockerfile @@ -57,7 +57,7 @@ RUN set -eux; \ --prefix=/usr/local \ --flags='+server +lua' \ --sysconfdir=/etc \ - --ghc-options='-optc-Os -optl=-pthread -fPIC -j4 +RTS -A256m -RTS' \ + --ghc-options='-optc-Os -optl=-pthread -fPIC -j4 +RTS -M4G -A256m -RTS' \ --constraint='any.Cabal ==3.4.1.0' \ --constraint='any.Glob ==0.10.2' \ --constraint='any.HUnit ==1.6.2.0' \