From 065ce7e05e56037f2ec3d67e0327ac6213f0b7c5 Mon Sep 17 00:00:00 2001 From: Andreas Resch Date: Fri, 10 Nov 2023 14:43:59 +0100 Subject: [PATCH 1/6] support arm --- .github/workflows/docker-publish.yml | 8 ++++--- Dockerfile | 36 ++++++++++++++-------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index a337558..74f6e74 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -9,7 +9,7 @@ on: push: branches: ["main"] # Publish semver tags as releases. - tags: ['v*.*.*'] + tags: ["v*.*.*"] pull_request: branches: ["main"] @@ -19,10 +19,8 @@ env: # github.repository as / IMAGE_NAME: ${{ github.repository }} - jobs: build: - runs-on: ubuntu-latest permissions: contents: read @@ -35,6 +33,10 @@ jobs: - name: Checkout repository uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + # support multiple architectures + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + # Workaround: https://github.com/docker/build-push-action/issues/461 - name: Setup Docker buildx uses: docker/setup-buildx-action@v3.0.0 diff --git a/Dockerfile b/Dockerfile index 84acb0c..388fea8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,23 +8,23 @@ COPY stack-config/config.yaml $STACK_ROOT/config.yaml COPY stack-config/global-project/stack.yaml $STACK_ROOT/global-project/stack.yaml RUN apt-get update \ - && apt-get -y install curl perl tar \ - && bash -c "curl -sSL https://get.haskellstack.org/ | sh" \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && apt-get -y install curl perl tar llvm libnuma-dev \ + && bash -c "curl -sSL https://get.haskellstack.org/ | sh" \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* RUN stack setup \ - && stack ghc \ - --package QuickCheck \ - --package quickcheck-assertions \ - --package smallcheck \ - --package tasty \ - --package tasty-ant-xml \ - --package tasty-hunit \ - --package tasty-quickcheck \ - --package tasty-smallcheck \ - --package unordered-containers \ - -- --version \ - # Jenkins runs the builds not as root, but with a system dependent user id. - # Therefore, we allow all users to access the stack cache. - && chmod -R a+rw $STACK_ROOT + && stack ghc \ + --package QuickCheck \ + --package quickcheck-assertions \ + --package smallcheck \ + --package tasty \ + --package tasty-ant-xml \ + --package tasty-hunit \ + --package tasty-quickcheck \ + --package tasty-smallcheck \ + --package unordered-containers \ + -- --version \ + # Jenkins runs the builds not as root, but with a system dependent user id. + # Therefore, we allow all users to access the stack cache. + && chmod -R a+rw $STACK_ROOT From 1acfa28f5e6b0d7d68d51ca1108d349a1bb2d88b Mon Sep 17 00:00:00 2001 From: Andreas Resch Date: Fri, 10 Nov 2023 15:04:47 +0100 Subject: [PATCH 2/6] add arm image --- .github/workflows/docker-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 74f6e74..c45de51 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -66,6 +66,7 @@ jobs: uses: docker/build-push-action@v5.0.0 with: context: . + platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From ba3425c3ad07f434bb1fc325d429abd6353d50e3 Mon Sep 17 00:00:00 2001 From: Andreas Resch Date: Sun, 12 Nov 2023 09:13:19 +0100 Subject: [PATCH 3/6] revert formatting to original --- .github/workflows/docker-publish.yml | 2 +- Dockerfile | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index c45de51..eccf0bc 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -9,7 +9,7 @@ on: push: branches: ["main"] # Publish semver tags as releases. - tags: ["v*.*.*"] + tags: ['v*.*.*'] pull_request: branches: ["main"] diff --git a/Dockerfile b/Dockerfile index 388fea8..fbd4a2b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,17 +14,17 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* RUN stack setup \ - && stack ghc \ - --package QuickCheck \ - --package quickcheck-assertions \ - --package smallcheck \ - --package tasty \ - --package tasty-ant-xml \ - --package tasty-hunit \ - --package tasty-quickcheck \ - --package tasty-smallcheck \ - --package unordered-containers \ - -- --version \ - # Jenkins runs the builds not as root, but with a system dependent user id. - # Therefore, we allow all users to access the stack cache. - && chmod -R a+rw $STACK_ROOT + && stack ghc \ + --package QuickCheck \ + --package quickcheck-assertions \ + --package smallcheck \ + --package tasty \ + --package tasty-ant-xml \ + --package tasty-hunit \ + --package tasty-quickcheck \ + --package tasty-smallcheck \ + --package unordered-containers \ + -- --version \ + # Jenkins runs the builds not as root, but with a system dependent user id. + # Therefore, we allow all users to access the stack cache. + && chmod -R a+rw $STACK_ROOT \ No newline at end of file From 0be603b708720a323d1937de0ec988851ca2f935 Mon Sep 17 00:00:00 2001 From: Andreas Resch Date: Sun, 12 Nov 2023 12:47:24 +0100 Subject: [PATCH 4/6] Update Dockerfile Co-authored-by: Benedikt Fein --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index fbd4a2b..56ad269 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,10 +8,10 @@ COPY stack-config/config.yaml $STACK_ROOT/config.yaml COPY stack-config/global-project/stack.yaml $STACK_ROOT/global-project/stack.yaml RUN apt-get update \ - && apt-get -y install curl perl tar llvm libnuma-dev \ - && bash -c "curl -sSL https://get.haskellstack.org/ | sh" \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && apt-get -y install curl perl tar llvm libnuma-dev \ + && bash -c "curl -sSL https://get.haskellstack.org/ | sh" \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* RUN stack setup \ && stack ghc \ From 1f50265171e059716bd87bae5a571831865e9490 Mon Sep 17 00:00:00 2001 From: Andreas Resch Date: Sun, 12 Nov 2023 12:47:33 +0100 Subject: [PATCH 5/6] Update Dockerfile Co-authored-by: Benedikt Fein --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 56ad269..81c3c25 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,4 +27,4 @@ RUN stack setup \ -- --version \ # Jenkins runs the builds not as root, but with a system dependent user id. # Therefore, we allow all users to access the stack cache. - && chmod -R a+rw $STACK_ROOT \ No newline at end of file + && chmod -R a+rw $STACK_ROOT From d536703563f6d095dbfc34e9f93a70f4c78be7d3 Mon Sep 17 00:00:00 2001 From: Andreas Resch Date: Mon, 13 Nov 2023 10:04:25 +0100 Subject: [PATCH 6/6] move to self-hosted runner Co-authored-by: Benedikt Fein --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index eccf0bc..9157948 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -21,7 +21,7 @@ env: jobs: build: - runs-on: ubuntu-latest + runs-on: self-hosted permissions: contents: read packages: write