From e47117b56c0852691168407e4403e12f7781effe Mon Sep 17 00:00:00 2001 From: Jappie Klooster Date: Wed, 21 Dec 2022 07:56:28 -0400 Subject: [PATCH 1/6] bump stack 8.10 --- 8.10/buster/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/8.10/buster/Dockerfile b/8.10/buster/Dockerfile index a23f0a2..8cee572 100644 --- a/8.10/buster/Dockerfile +++ b/8.10/buster/Dockerfile @@ -9,7 +9,7 @@ RUN apt-get update && \ libtinfo-dev && \ rm -rf /var/lib/apt/lists/* -ARG STACK=2.9.1 +ARG STACK=2.9.3 ARG STACK_RELEASE_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442 RUN set -eux; \ From d21e9b0752bb5099b220f61d879c6a79b58d18f2 Mon Sep 17 00:00:00 2001 From: Jappie Klooster Date: Wed, 21 Dec 2022 13:13:27 +0100 Subject: [PATCH 2/6] bump all stack versions --- 8.10/slim-buster/Dockerfile | 2 +- 9.0/buster/Dockerfile | 2 +- 9.0/slim-buster/Dockerfile | 2 +- 9.2/buster/Dockerfile | 2 +- 9.2/slim-buster/Dockerfile | 2 +- 9.4/buster/Dockerfile | 2 +- 9.4/slim-buster/Dockerfile | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/8.10/slim-buster/Dockerfile b/8.10/slim-buster/Dockerfile index e062877..3391432 100644 --- a/8.10/slim-buster/Dockerfile +++ b/8.10/slim-buster/Dockerfile @@ -23,7 +23,7 @@ RUN apt-get update && \ zlib1g-dev && \ rm -rf /var/lib/apt/lists/* -ARG STACK=2.9.1 +ARG STACK=2.9.3 ARG STACK_RELEASE_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442 RUN set -eux; \ diff --git a/9.0/buster/Dockerfile b/9.0/buster/Dockerfile index e628277..b0595f3 100644 --- a/9.0/buster/Dockerfile +++ b/9.0/buster/Dockerfile @@ -9,7 +9,7 @@ RUN apt-get update && \ libtinfo-dev && \ rm -rf /var/lib/apt/lists/* -ARG STACK=2.9.1 +ARG STACK=2.9.3 ARG STACK_RELEASE_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442 RUN set -eux; \ diff --git a/9.0/slim-buster/Dockerfile b/9.0/slim-buster/Dockerfile index d5840fd..d0680f5 100644 --- a/9.0/slim-buster/Dockerfile +++ b/9.0/slim-buster/Dockerfile @@ -23,7 +23,7 @@ RUN apt-get update && \ zlib1g-dev && \ rm -rf /var/lib/apt/lists/* -ARG STACK=2.9.1 +ARG STACK=2.9.3 ARG STACK_RELEASE_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442 RUN set -eux; \ diff --git a/9.2/buster/Dockerfile b/9.2/buster/Dockerfile index 921b931..b58da8e 100644 --- a/9.2/buster/Dockerfile +++ b/9.2/buster/Dockerfile @@ -9,7 +9,7 @@ RUN apt-get update && \ libtinfo-dev && \ rm -rf /var/lib/apt/lists/* -ARG STACK=2.9.1 +ARG STACK=2.9.3 ARG STACK_RELEASE_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442 RUN set -eux; \ diff --git a/9.2/slim-buster/Dockerfile b/9.2/slim-buster/Dockerfile index ef33a3d..9c0b9e4 100644 --- a/9.2/slim-buster/Dockerfile +++ b/9.2/slim-buster/Dockerfile @@ -23,7 +23,7 @@ RUN apt-get update && \ zlib1g-dev && \ rm -rf /var/lib/apt/lists/* -ARG STACK=2.9.1 +ARG STACK=2.9.3 ARG STACK_RELEASE_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442 RUN set -eux; \ diff --git a/9.4/buster/Dockerfile b/9.4/buster/Dockerfile index 8a03984..cacb551 100644 --- a/9.4/buster/Dockerfile +++ b/9.4/buster/Dockerfile @@ -9,7 +9,7 @@ RUN apt-get update && \ libtinfo-dev && \ rm -rf /var/lib/apt/lists/* -ARG STACK=2.9.1 +ARG STACK=2.9.3 ARG STACK_RELEASE_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442 RUN set -eux; \ diff --git a/9.4/slim-buster/Dockerfile b/9.4/slim-buster/Dockerfile index df2c338..4ac9534 100644 --- a/9.4/slim-buster/Dockerfile +++ b/9.4/slim-buster/Dockerfile @@ -23,7 +23,7 @@ RUN apt-get update && \ zlib1g-dev && \ rm -rf /var/lib/apt/lists/* -ARG STACK=2.9.1 +ARG STACK=2.9.3 ARG STACK_RELEASE_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442 RUN set -eux; \ From 5882f199a4e62cf5663c41bceaa067b7ee2f9f24 Mon Sep 17 00:00:00 2001 From: Jappie Klooster Date: Wed, 21 Dec 2022 13:28:16 +0100 Subject: [PATCH 3/6] add stack multi arch support --- 9.4/buster/Dockerfile | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/9.4/buster/Dockerfile b/9.4/buster/Dockerfile index cacb551..60bdedf 100644 --- a/9.4/buster/Dockerfile +++ b/9.4/buster/Dockerfile @@ -15,39 +15,33 @@ ARG STACK_RELEASE_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442 RUN set -eux; \ cd /tmp; \ ARCH="$(dpkg-architecture --query DEB_BUILD_GNU_CPU)"; \ - INSTALL_STACK="true"; \ STACK_URL="https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz"; \ # sha256 from https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz.sha256 case "$ARCH" in \ 'aarch64') \ - # Stack does not officially support ARM64, nor do the binaries that exist work. - # Hitting https://github.com/commercialhaskell/stack/issues/2103#issuecomment-972329065 when trying to use - # stack-2.7.1-linux-aarch64.tar.gz - INSTALL_STACK="false"; \ + STACK_SHA256='0581cebe880b8ed47556ee73d8bbb9d602b5b82e38f89f6aa53acaec37e7760d'; \ ;; \ 'x86_64') \ STACK_SHA256='0581cebe880b8ed47556ee73d8bbb9d602b5b82e38f89f6aa53acaec37e7760d'; \ ;; \ *) echo >&2 "error: unsupported architecture '$ARCH'" ; exit 1 ;; \ esac; \ - if [ "$INSTALL_STACK" = "true" ]; then \ - curl -sSL "$STACK_URL" -o stack.tar.gz; \ - echo "$STACK_SHA256 stack.tar.gz" | sha256sum --strict --check; \ - \ - curl -sSL "$STACK_URL.asc" -o stack.tar.gz.asc; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - gpg --batch --keyserver keyserver.ubuntu.com --receive-keys "$STACK_RELEASE_KEY"; \ - gpg --batch --verify stack.tar.gz.asc stack.tar.gz; \ - gpgconf --kill all; \ - \ - tar -xf stack.tar.gz -C /usr/local/bin --strip-components=1 "stack-$STACK-linux-$ARCH/stack"; \ - stack config set system-ghc --global true; \ - stack config set install-ghc --global false; \ - \ - rm -rf /tmp/*; \ - \ - stack --version; \ - fi + curl -sSL "$STACK_URL" -o stack.tar.gz; \ + echo "$STACK_SHA256 stack.tar.gz" | sha256sum --strict --check; \ + \ + curl -sSL "$STACK_URL.asc" -o stack.tar.gz.asc; \ + GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ + gpg --batch --keyserver keyserver.ubuntu.com --receive-keys "$STACK_RELEASE_KEY"; \ + gpg --batch --verify stack.tar.gz.asc stack.tar.gz; \ + gpgconf --kill all; \ + \ + tar -xf stack.tar.gz -C /usr/local/bin --strip-components=1 "stack-$STACK-linux-$ARCH/stack"; \ + stack config set system-ghc --global true; \ + stack config set install-ghc --global false; \ + \ + rm -rf /tmp/*; \ + \ + stack --version; \ ARG CABAL_INSTALL=3.8.1.0 ARG CABAL_INSTALL_RELEASE_KEY=E9EC5616017C3EE26B33468CCE1ED8AE0B011D8C From 8b621fb2f9b260a47ef991bfa17566271f7f5a2e Mon Sep 17 00:00:00 2001 From: Jappie Klooster Date: Wed, 21 Dec 2022 13:57:53 +0100 Subject: [PATCH 4/6] See if I can re-use the install stack code --- .../Dockerfile => 8.10_buster.dockerfile | 38 +------------------ install-stack.sh | 33 ++++++++++++++++ 2 files changed, 35 insertions(+), 36 deletions(-) rename 8.10/buster/Dockerfile => 8.10_buster.dockerfile (71%) create mode 100755 install-stack.sh diff --git a/8.10/buster/Dockerfile b/8.10_buster.dockerfile similarity index 71% rename from 8.10/buster/Dockerfile rename to 8.10_buster.dockerfile index 8cee572..c02a69d 100644 --- a/8.10/buster/Dockerfile +++ b/8.10_buster.dockerfile @@ -12,42 +12,8 @@ RUN apt-get update && \ ARG STACK=2.9.3 ARG STACK_RELEASE_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442 -RUN set -eux; \ - cd /tmp; \ - ARCH="$(dpkg-architecture --query DEB_BUILD_GNU_CPU)"; \ - INSTALL_STACK="true"; \ - STACK_URL="https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz"; \ - # sha256 from https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz.sha256 - case "$ARCH" in \ - 'aarch64') \ - # Stack does not officially support ARM64, nor do the binaries that exist work. - # Hitting https://github.com/commercialhaskell/stack/issues/2103#issuecomment-972329065 when trying to use - # stack-2.7.1-linux-aarch64.tar.gz - INSTALL_STACK="false"; \ - ;; \ - 'x86_64') \ - STACK_SHA256='0581cebe880b8ed47556ee73d8bbb9d602b5b82e38f89f6aa53acaec37e7760d'; \ - ;; \ - *) echo >&2 "error: unsupported architecture '$ARCH'" ; exit 1 ;; \ - esac; \ - if [ "$INSTALL_STACK" = "true" ]; then \ - curl -sSL "$STACK_URL" -o stack.tar.gz; \ - echo "$STACK_SHA256 stack.tar.gz" | sha256sum --strict --check; \ - \ - curl -sSL "$STACK_URL.asc" -o stack.tar.gz.asc; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - gpg --batch --keyserver keyserver.ubuntu.com --receive-keys "$STACK_RELEASE_KEY"; \ - gpg --batch --verify stack.tar.gz.asc stack.tar.gz; \ - gpgconf --kill all; \ - \ - tar -xf stack.tar.gz -C /usr/local/bin --strip-components=1 "stack-$STACK-linux-$ARCH/stack"; \ - stack config set system-ghc --global true; \ - stack config set install-ghc --global false; \ - \ - rm -rf /tmp/*; \ - \ - stack --version; \ - fi +COPY ./install-stack.sh ./ +RUN ./install-stack.sh ARG CABAL_INSTALL=3.8.1.0 ARG CABAL_INSTALL_RELEASE_KEY=E9EC5616017C3EE26B33468CCE1ED8AE0B011D8C diff --git a/install-stack.sh b/install-stack.sh new file mode 100755 index 0000000..9554b50 --- /dev/null +++ b/install-stack.sh @@ -0,0 +1,33 @@ +#! /bin/sh + +set -eux; + +cd /tmp; +ARCH="$(dpkg-architecture --query DEB_BUILD_GNU_CPU)"; +STACK_URL="https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz"; +# sha256 from https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz.sha256 +case "$ARCH" in + 'aarch64') + STACK_SHA256='0581cebe880b8ed47556ee73d8bbb9d602b5b82e38f89f6aa53acaec37e7760d'; + ;; + 'x86_64') + STACK_SHA256='0581cebe880b8ed47556ee73d8bbb9d602b5b82e38f89f6aa53acaec37e7760d'; + ;; + *) echo >&2 "error: unsupported architecture '$ARCH'" ; exit 1 ;; +esac; +curl -sSL "$STACK_URL" -o stack.tar.gz; +echo "$STACK_SHA256 stack.tar.gz" | sha256sum --strict --check; + +curl -sSL "$STACK_URL.asc" -o stack.tar.gz.asc; +GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; +gpg --batch --keyserver keyserver.ubuntu.com --receive-keys "$STACK_RELEASE_KEY"; +gpg --batch --verify stack.tar.gz.asc stack.tar.gz; +gpgconf --kill all; + +tar -xf stack.tar.gz -C /usr/local/bin --strip-components=1 "stack-$STACK-linux-$ARCH/stack"; +stack config set system-ghc --global true; +stack config set install-ghc --global false; + +rm -rf /tmp/*; + +stack --version; From a0810a4a957b1f4dcf7fd39e7fe118051ac405ea Mon Sep 17 00:00:00 2001 From: Jappie Klooster Date: Wed, 21 Dec 2022 15:15:31 +0100 Subject: [PATCH 5/6] Move out more docker files --- .github/workflows/debian.yml | 3 +- .github/workflows/lint.yml | 1 + .../Dockerfile => 8.10_slim-buster.dockerfile | 38 +------------------ .../Dockerfile => 9.0_buster.dockerfile | 0 4 files changed, 5 insertions(+), 37 deletions(-) rename 8.10/slim-buster/Dockerfile => 8.10_slim-buster.dockerfile (73%) rename 9.0/buster/Dockerfile => 9.0_buster.dockerfile (100%) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index 4c79ce4..0161043 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -90,7 +90,8 @@ jobs: docker build --pull \ --platform "linux/${{ matrix.docker_platform }}" \ -t haskell:${{ matrix.ghc }}-${{ matrix.deb }} \ - ${{ matrix.ghc_minor }}/${{ matrix.deb }} + -f ${{ matrix.ghc_minor }}_${{ matrix.deb }}.dockerfile + . echo 'testing..' docker run \ --platform "linux/${{ matrix.docker_platform }}" \ diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3b4e6ef..f16cbe0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,6 +6,7 @@ on: - master paths: - '**/Dockerfile' + - '*.dockerfile' - '.github/workflows/lint.yml' jobs: diff --git a/8.10/slim-buster/Dockerfile b/8.10_slim-buster.dockerfile similarity index 73% rename from 8.10/slim-buster/Dockerfile rename to 8.10_slim-buster.dockerfile index 3391432..ad1a821 100644 --- a/8.10/slim-buster/Dockerfile +++ b/8.10_slim-buster.dockerfile @@ -26,42 +26,8 @@ RUN apt-get update && \ ARG STACK=2.9.3 ARG STACK_RELEASE_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442 -RUN set -eux; \ - cd /tmp; \ - ARCH="$(dpkg-architecture --query DEB_BUILD_GNU_CPU)"; \ - INSTALL_STACK="true"; \ - STACK_URL="https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz"; \ - # sha256 from https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz.sha256 - case "$ARCH" in \ - 'aarch64') \ - # Stack does not officially support ARM64, nor do the binaries that exist work. - # Hitting https://github.com/commercialhaskell/stack/issues/2103#issuecomment-972329065 when trying to use - # stack-2.7.1-linux-aarch64.tar.gz - INSTALL_STACK="false"; \ - ;; \ - 'x86_64') \ - STACK_SHA256='0581cebe880b8ed47556ee73d8bbb9d602b5b82e38f89f6aa53acaec37e7760d'; \ - ;; \ - *) echo >&2 "error: unsupported architecture '$ARCH'" ; exit 1 ;; \ - esac; \ - if [ "$INSTALL_STACK" = "true" ]; then \ - curl -sSL "$STACK_URL" -o stack.tar.gz; \ - echo "$STACK_SHA256 stack.tar.gz" | sha256sum --strict --check; \ - \ - curl -sSL "$STACK_URL.asc" -o stack.tar.gz.asc; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - gpg --batch --keyserver keyserver.ubuntu.com --receive-keys "$STACK_RELEASE_KEY"; \ - gpg --batch --verify stack.tar.gz.asc stack.tar.gz; \ - gpgconf --kill all; \ - \ - tar -xf stack.tar.gz -C /usr/local/bin --strip-components=1 "stack-$STACK-linux-$ARCH/stack"; \ - stack config set system-ghc --global true; \ - stack config set install-ghc --global false; \ - \ - rm -rf /tmp/*; \ - \ - stack --version; \ - fi +COPY ./install-stack.sh ./ +RUN ./install-stack.sh ARG CABAL_INSTALL=3.8.1.0 ARG CABAL_INSTALL_RELEASE_KEY=E9EC5616017C3EE26B33468CCE1ED8AE0B011D8C diff --git a/9.0/buster/Dockerfile b/9.0_buster.dockerfile similarity index 100% rename from 9.0/buster/Dockerfile rename to 9.0_buster.dockerfile From 097da1a0b97c6bb83ec90e3414b21e24fbadb553 Mon Sep 17 00:00:00 2001 From: Jappie Klooster Date: Wed, 21 Dec 2022 17:40:54 +0100 Subject: [PATCH 6/6] use external script for other dockerfiles --- 9.0_buster.dockerfile | 38 +------------------ .../Dockerfile => 9.0_slim-buster.dockerfile | 38 +------------------ .../Dockerfile => 9.2_buster.dockerfile | 38 +------------------ .../Dockerfile => 9.2_slim-buster.dockerfile | 38 +------------------ .../Dockerfile => 9.4_buster.dockerfile | 32 +--------------- .../Dockerfile => 9.4_slim-buster.dockerfile | 38 +------------------ 6 files changed, 12 insertions(+), 210 deletions(-) rename 9.0/slim-buster/Dockerfile => 9.0_slim-buster.dockerfile (73%) rename 9.2/buster/Dockerfile => 9.2_buster.dockerfile (66%) rename 9.2/slim-buster/Dockerfile => 9.2_slim-buster.dockerfile (68%) rename 9.4/buster/Dockerfile => 9.4_buster.dockerfile (71%) rename 9.4/slim-buster/Dockerfile => 9.4_slim-buster.dockerfile (69%) diff --git a/9.0_buster.dockerfile b/9.0_buster.dockerfile index b0595f3..af27e80 100644 --- a/9.0_buster.dockerfile +++ b/9.0_buster.dockerfile @@ -12,42 +12,8 @@ RUN apt-get update && \ ARG STACK=2.9.3 ARG STACK_RELEASE_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442 -RUN set -eux; \ - cd /tmp; \ - ARCH="$(dpkg-architecture --query DEB_BUILD_GNU_CPU)"; \ - INSTALL_STACK="true"; \ - STACK_URL="https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz"; \ - # sha256 from https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz.sha256 - case "$ARCH" in \ - 'aarch64') \ - # Stack does not officially support ARM64, nor do the binaries that exist work. - # Hitting https://github.com/commercialhaskell/stack/issues/2103#issuecomment-972329065 when trying to use - # stack-2.7.1-linux-aarch64.tar.gz - INSTALL_STACK="false"; \ - ;; \ - 'x86_64') \ - STACK_SHA256='0581cebe880b8ed47556ee73d8bbb9d602b5b82e38f89f6aa53acaec37e7760d'; \ - ;; \ - *) echo >&2 "error: unsupported architecture '$ARCH'" ; exit 1 ;; \ - esac; \ - if [ "$INSTALL_STACK" = "true" ]; then \ - curl -sSL "$STACK_URL" -o stack.tar.gz; \ - echo "$STACK_SHA256 stack.tar.gz" | sha256sum --strict --check; \ - \ - curl -sSL "$STACK_URL.asc" -o stack.tar.gz.asc; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - gpg --batch --keyserver keyserver.ubuntu.com --receive-keys "$STACK_RELEASE_KEY"; \ - gpg --batch --verify stack.tar.gz.asc stack.tar.gz; \ - gpgconf --kill all; \ - \ - tar -xf stack.tar.gz -C /usr/local/bin --strip-components=1 "stack-$STACK-linux-$ARCH/stack"; \ - stack config set system-ghc --global true; \ - stack config set install-ghc --global false; \ - \ - rm -rf /tmp/*; \ - \ - stack --version; \ - fi +COPY ./install-stack.sh ./ +RUN ./install-stack.sh ARG CABAL_INSTALL=3.8.1.0 ARG CABAL_INSTALL_RELEASE_KEY=E9EC5616017C3EE26B33468CCE1ED8AE0B011D8C diff --git a/9.0/slim-buster/Dockerfile b/9.0_slim-buster.dockerfile similarity index 73% rename from 9.0/slim-buster/Dockerfile rename to 9.0_slim-buster.dockerfile index d0680f5..0f47917 100644 --- a/9.0/slim-buster/Dockerfile +++ b/9.0_slim-buster.dockerfile @@ -26,42 +26,8 @@ RUN apt-get update && \ ARG STACK=2.9.3 ARG STACK_RELEASE_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442 -RUN set -eux; \ - cd /tmp; \ - ARCH="$(dpkg-architecture --query DEB_BUILD_GNU_CPU)"; \ - INSTALL_STACK="true"; \ - STACK_URL="https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz"; \ - # sha256 from https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz.sha256 - case "$ARCH" in \ - 'aarch64') \ - # Stack does not officially support ARM64, nor do the binaries that exist work. - # Hitting https://github.com/commercialhaskell/stack/issues/2103#issuecomment-972329065 when trying to use - # stack-2.7.1-linux-aarch64.tar.gz - INSTALL_STACK="false"; \ - ;; \ - 'x86_64') \ - STACK_SHA256='0581cebe880b8ed47556ee73d8bbb9d602b5b82e38f89f6aa53acaec37e7760d'; \ - ;; \ - *) echo >&2 "error: unsupported architecture '$ARCH'" ; exit 1 ;; \ - esac; \ - if [ "$INSTALL_STACK" = "true" ]; then \ - curl -sSL "$STACK_URL" -o stack.tar.gz; \ - echo "$STACK_SHA256 stack.tar.gz" | sha256sum --strict --check; \ - \ - curl -sSL "$STACK_URL.asc" -o stack.tar.gz.asc; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - gpg --batch --keyserver keyserver.ubuntu.com --receive-keys "$STACK_RELEASE_KEY"; \ - gpg --batch --verify stack.tar.gz.asc stack.tar.gz; \ - gpgconf --kill all; \ - \ - tar -xf stack.tar.gz -C /usr/local/bin --strip-components=1 "stack-$STACK-linux-$ARCH/stack"; \ - stack config set system-ghc --global true; \ - stack config set install-ghc --global false; \ - \ - rm -rf /tmp/*; \ - \ - stack --version; \ - fi +COPY ./install-stack.sh ./ +RUN ./install-stack.sh ARG CABAL_INSTALL=3.8.1.0 ARG CABAL_INSTALL_RELEASE_KEY=E9EC5616017C3EE26B33468CCE1ED8AE0B011D8C diff --git a/9.2/buster/Dockerfile b/9.2_buster.dockerfile similarity index 66% rename from 9.2/buster/Dockerfile rename to 9.2_buster.dockerfile index b58da8e..01ac87f 100644 --- a/9.2/buster/Dockerfile +++ b/9.2_buster.dockerfile @@ -12,42 +12,8 @@ RUN apt-get update && \ ARG STACK=2.9.3 ARG STACK_RELEASE_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442 -RUN set -eux; \ - cd /tmp; \ - ARCH="$(dpkg-architecture --query DEB_BUILD_GNU_CPU)"; \ - INSTALL_STACK="true"; \ - STACK_URL="https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz"; \ - # sha256 from https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz.sha256 - case "$ARCH" in \ - 'aarch64') \ - # Stack does not officially support ARM64, nor do the binaries that exist work. - # Hitting https://github.com/commercialhaskell/stack/issues/2103#issuecomment-972329065 when trying to use - # stack-2.7.1-linux-aarch64.tar.gz - INSTALL_STACK="false"; \ - ;; \ - 'x86_64') \ - STACK_SHA256='0581cebe880b8ed47556ee73d8bbb9d602b5b82e38f89f6aa53acaec37e7760d'; \ - ;; \ - *) echo >&2 "error: unsupported architecture '$ARCH'" ; exit 1 ;; \ - esac; \ - if [ "$INSTALL_STACK" = "true" ]; then \ - curl -sSL "$STACK_URL" -o stack.tar.gz; \ - echo "$STACK_SHA256 stack.tar.gz" | sha256sum --strict --check; \ - \ - curl -sSL "$STACK_URL.asc" -o stack.tar.gz.asc; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - gpg --batch --keyserver keyserver.ubuntu.com --receive-keys "$STACK_RELEASE_KEY"; \ - gpg --batch --verify stack.tar.gz.asc stack.tar.gz; \ - gpgconf --kill all; \ - \ - tar -xf stack.tar.gz -C /usr/local/bin --strip-components=1 "stack-$STACK-linux-$ARCH/stack"; \ - stack config set system-ghc --global true; \ - stack config set install-ghc --global false; \ - \ - rm -rf /tmp/*; \ - \ - stack --version; \ - fi +COPY ./install-stack.sh ./ +RUN ./install-stack.sh ARG CABAL_INSTALL=3.8.1.0 ARG CABAL_INSTALL_RELEASE_KEY=E9EC5616017C3EE26B33468CCE1ED8AE0B011D8C diff --git a/9.2/slim-buster/Dockerfile b/9.2_slim-buster.dockerfile similarity index 68% rename from 9.2/slim-buster/Dockerfile rename to 9.2_slim-buster.dockerfile index 9c0b9e4..558c053 100644 --- a/9.2/slim-buster/Dockerfile +++ b/9.2_slim-buster.dockerfile @@ -26,42 +26,8 @@ RUN apt-get update && \ ARG STACK=2.9.3 ARG STACK_RELEASE_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442 -RUN set -eux; \ - cd /tmp; \ - ARCH="$(dpkg-architecture --query DEB_BUILD_GNU_CPU)"; \ - INSTALL_STACK="true"; \ - STACK_URL="https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz"; \ - # sha256 from https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz.sha256 - case "$ARCH" in \ - 'aarch64') \ - # Stack does not officially support ARM64, nor do the binaries that exist work. - # Hitting https://github.com/commercialhaskell/stack/issues/2103#issuecomment-972329065 when trying to use - # stack-2.7.1-linux-aarch64.tar.gz - INSTALL_STACK="false"; \ - ;; \ - 'x86_64') \ - STACK_SHA256='0581cebe880b8ed47556ee73d8bbb9d602b5b82e38f89f6aa53acaec37e7760d'; \ - ;; \ - *) echo >&2 "error: unsupported architecture '$ARCH'" ; exit 1 ;; \ - esac; \ - if [ "$INSTALL_STACK" = "true" ]; then \ - curl -sSL "$STACK_URL" -o stack.tar.gz; \ - echo "$STACK_SHA256 stack.tar.gz" | sha256sum --strict --check; \ - \ - curl -sSL "$STACK_URL.asc" -o stack.tar.gz.asc; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - gpg --batch --keyserver keyserver.ubuntu.com --receive-keys "$STACK_RELEASE_KEY"; \ - gpg --batch --verify stack.tar.gz.asc stack.tar.gz; \ - gpgconf --kill all; \ - \ - tar -xf stack.tar.gz -C /usr/local/bin --strip-components=1 "stack-$STACK-linux-$ARCH/stack"; \ - stack config set system-ghc --global true; \ - stack config set install-ghc --global false; \ - \ - rm -rf /tmp/*; \ - \ - stack --version; \ - fi +COPY ./install-stack.sh ./ +RUN ./install-stack.sh ARG CABAL_INSTALL=3.8.1.0 ARG CABAL_INSTALL_RELEASE_KEY=E9EC5616017C3EE26B33468CCE1ED8AE0B011D8C diff --git a/9.4/buster/Dockerfile b/9.4_buster.dockerfile similarity index 71% rename from 9.4/buster/Dockerfile rename to 9.4_buster.dockerfile index 60bdedf..7f56860 100644 --- a/9.4/buster/Dockerfile +++ b/9.4_buster.dockerfile @@ -12,36 +12,8 @@ RUN apt-get update && \ ARG STACK=2.9.3 ARG STACK_RELEASE_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442 -RUN set -eux; \ - cd /tmp; \ - ARCH="$(dpkg-architecture --query DEB_BUILD_GNU_CPU)"; \ - STACK_URL="https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz"; \ - # sha256 from https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz.sha256 - case "$ARCH" in \ - 'aarch64') \ - STACK_SHA256='0581cebe880b8ed47556ee73d8bbb9d602b5b82e38f89f6aa53acaec37e7760d'; \ - ;; \ - 'x86_64') \ - STACK_SHA256='0581cebe880b8ed47556ee73d8bbb9d602b5b82e38f89f6aa53acaec37e7760d'; \ - ;; \ - *) echo >&2 "error: unsupported architecture '$ARCH'" ; exit 1 ;; \ - esac; \ - curl -sSL "$STACK_URL" -o stack.tar.gz; \ - echo "$STACK_SHA256 stack.tar.gz" | sha256sum --strict --check; \ - \ - curl -sSL "$STACK_URL.asc" -o stack.tar.gz.asc; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - gpg --batch --keyserver keyserver.ubuntu.com --receive-keys "$STACK_RELEASE_KEY"; \ - gpg --batch --verify stack.tar.gz.asc stack.tar.gz; \ - gpgconf --kill all; \ - \ - tar -xf stack.tar.gz -C /usr/local/bin --strip-components=1 "stack-$STACK-linux-$ARCH/stack"; \ - stack config set system-ghc --global true; \ - stack config set install-ghc --global false; \ - \ - rm -rf /tmp/*; \ - \ - stack --version; \ +COPY ./install-stack.sh ./ +RUN ./install-stack.sh ARG CABAL_INSTALL=3.8.1.0 ARG CABAL_INSTALL_RELEASE_KEY=E9EC5616017C3EE26B33468CCE1ED8AE0B011D8C diff --git a/9.4/slim-buster/Dockerfile b/9.4_slim-buster.dockerfile similarity index 69% rename from 9.4/slim-buster/Dockerfile rename to 9.4_slim-buster.dockerfile index 4ac9534..68df6da 100644 --- a/9.4/slim-buster/Dockerfile +++ b/9.4_slim-buster.dockerfile @@ -26,42 +26,8 @@ RUN apt-get update && \ ARG STACK=2.9.3 ARG STACK_RELEASE_KEY=C5705533DA4F78D8664B5DC0575159689BEFB442 -RUN set -eux; \ - cd /tmp; \ - ARCH="$(dpkg-architecture --query DEB_BUILD_GNU_CPU)"; \ - INSTALL_STACK="true"; \ - STACK_URL="https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz"; \ - # sha256 from https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz.sha256 - case "$ARCH" in \ - 'aarch64') \ - # Stack does not officially support ARM64, nor do the binaries that exist work. - # Hitting https://github.com/commercialhaskell/stack/issues/2103#issuecomment-972329065 when trying to use - # stack-2.7.1-linux-aarch64.tar.gz - INSTALL_STACK="false"; \ - ;; \ - 'x86_64') \ - STACK_SHA256='0581cebe880b8ed47556ee73d8bbb9d602b5b82e38f89f6aa53acaec37e7760d'; \ - ;; \ - *) echo >&2 "error: unsupported architecture '$ARCH'" ; exit 1 ;; \ - esac; \ - if [ "$INSTALL_STACK" = "true" ]; then \ - curl -sSL "$STACK_URL" -o stack.tar.gz; \ - echo "$STACK_SHA256 stack.tar.gz" | sha256sum --strict --check; \ - \ - curl -sSL "$STACK_URL.asc" -o stack.tar.gz.asc; \ - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ - gpg --batch --keyserver keyserver.ubuntu.com --receive-keys "$STACK_RELEASE_KEY"; \ - gpg --batch --verify stack.tar.gz.asc stack.tar.gz; \ - gpgconf --kill all; \ - \ - tar -xf stack.tar.gz -C /usr/local/bin --strip-components=1 "stack-$STACK-linux-$ARCH/stack"; \ - stack config set system-ghc --global true; \ - stack config set install-ghc --global false; \ - \ - rm -rf /tmp/*; \ - \ - stack --version; \ - fi +COPY ./install-stack.sh ./ +RUN ./install-stack.sh ARG CABAL_INSTALL=3.8.1.0 ARG CABAL_INSTALL_RELEASE_KEY=E9EC5616017C3EE26B33468CCE1ED8AE0B011D8C