From 8252567b572b8821baf7fc1897b25fa95cc4a0c3 Mon Sep 17 00:00:00 2001 From: Alistair Burrowes Date: Sun, 13 Mar 2022 16:06:20 +1100 Subject: [PATCH] Improve layer caching between images It is probably best to make the images share the same docker layers as much as possible between GHC versions. --- 8.10/buster/Dockerfile | 80 ++++++++++++++++++------------------- 8.10/slim-buster/Dockerfile | 80 ++++++++++++++++++------------------- 9.0/buster/Dockerfile | 80 ++++++++++++++++++------------------- 9.0/slim-buster/Dockerfile | 80 ++++++++++++++++++------------------- 9.2/buster/Dockerfile | 80 ++++++++++++++++++------------------- 9.2/slim-buster/Dockerfile | 80 ++++++++++++++++++------------------- 6 files changed, 240 insertions(+), 240 deletions(-) diff --git a/8.10/buster/Dockerfile b/8.10/buster/Dockerfile index 1a91e47..cf669e7 100644 --- a/8.10/buster/Dockerfile +++ b/8.10/buster/Dockerfile @@ -25,6 +25,46 @@ RUN apt-get update && \ zlib1g-dev && \ rm -rf /var/lib/apt/lists/* +ARG STACK=2.7.5 +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='9bcd165358d4dcafd2b33320d4fe98ce72faaf62300cc9b0fb86a27eb670da50'; \ + ;; \ + *) 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 + ARG CABAL_INSTALL=3.6.2.0 ARG CABAL_INSTALL_RELEASE_KEY=A970DF3AC3B9709706D74544B3D9F94B8DCAE210 @@ -116,46 +156,6 @@ RUN set -eux; \ \ "/opt/ghc/$GHC/bin/ghc" --version -ARG STACK=2.7.5 -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='9bcd165358d4dcafd2b33320d4fe98ce72faaf62300cc9b0fb86a27eb670da50'; \ - ;; \ - *) 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 - ENV PATH /root/.cabal/bin:/root/.local/bin:/opt/ghc/${GHC}/bin:$PATH CMD ["ghci"] diff --git a/8.10/slim-buster/Dockerfile b/8.10/slim-buster/Dockerfile index 869479f..fd3c37b 100644 --- a/8.10/slim-buster/Dockerfile +++ b/8.10/slim-buster/Dockerfile @@ -23,6 +23,46 @@ RUN apt-get update && \ zlib1g-dev && \ rm -rf /var/lib/apt/lists/* +ARG STACK=2.7.5 +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='9bcd165358d4dcafd2b33320d4fe98ce72faaf62300cc9b0fb86a27eb670da50'; \ + ;; \ + *) 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 + ARG CABAL_INSTALL=3.6.2.0 ARG CABAL_INSTALL_RELEASE_KEY=A970DF3AC3B9709706D74544B3D9F94B8DCAE210 @@ -116,46 +156,6 @@ RUN set -eux; \ \ "/opt/ghc/$GHC/bin/ghc" --version -ARG STACK=2.7.5 -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='9bcd165358d4dcafd2b33320d4fe98ce72faaf62300cc9b0fb86a27eb670da50'; \ - ;; \ - *) 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 - ENV PATH /root/.cabal/bin:/root/.local/bin:/opt/ghc/${GHC}/bin:$PATH CMD ["ghci"] diff --git a/9.0/buster/Dockerfile b/9.0/buster/Dockerfile index 7111bf4..0751ef9 100644 --- a/9.0/buster/Dockerfile +++ b/9.0/buster/Dockerfile @@ -25,6 +25,46 @@ RUN apt-get update && \ zlib1g-dev && \ rm -rf /var/lib/apt/lists/* +ARG STACK=2.7.5 +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='9bcd165358d4dcafd2b33320d4fe98ce72faaf62300cc9b0fb86a27eb670da50'; \ + ;; \ + *) 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 + ARG CABAL_INSTALL=3.6.2.0 ARG CABAL_INSTALL_RELEASE_KEY=A970DF3AC3B9709706D74544B3D9F94B8DCAE210 @@ -116,46 +156,6 @@ RUN set -eux; \ \ "/opt/ghc/$GHC/bin/ghc" --version -ARG STACK=2.7.5 -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='9bcd165358d4dcafd2b33320d4fe98ce72faaf62300cc9b0fb86a27eb670da50'; \ - ;; \ - *) 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 - ENV PATH /root/.cabal/bin:/root/.local/bin:/opt/ghc/${GHC}/bin:$PATH CMD ["ghci"] diff --git a/9.0/slim-buster/Dockerfile b/9.0/slim-buster/Dockerfile index c5e5c5d..b1c8813 100644 --- a/9.0/slim-buster/Dockerfile +++ b/9.0/slim-buster/Dockerfile @@ -23,6 +23,46 @@ RUN apt-get update && \ zlib1g-dev && \ rm -rf /var/lib/apt/lists/* +ARG STACK=2.7.5 +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='9bcd165358d4dcafd2b33320d4fe98ce72faaf62300cc9b0fb86a27eb670da50'; \ + ;; \ + *) 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 + ARG CABAL_INSTALL=3.6.2.0 ARG CABAL_INSTALL_RELEASE_KEY=A970DF3AC3B9709706D74544B3D9F94B8DCAE210 @@ -116,46 +156,6 @@ RUN set -eux; \ \ "/opt/ghc/$GHC/bin/ghc" --version -ARG STACK=2.7.5 -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='9bcd165358d4dcafd2b33320d4fe98ce72faaf62300cc9b0fb86a27eb670da50'; \ - ;; \ - *) 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 - ENV PATH /root/.cabal/bin:/root/.local/bin:/opt/ghc/${GHC}/bin:$PATH CMD ["ghci"] diff --git a/9.2/buster/Dockerfile b/9.2/buster/Dockerfile index 843e0aa..1cfd496 100644 --- a/9.2/buster/Dockerfile +++ b/9.2/buster/Dockerfile @@ -25,6 +25,46 @@ RUN apt-get update && \ zlib1g-dev && \ rm -rf /var/lib/apt/lists/* +ARG STACK=2.7.5 +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='9bcd165358d4dcafd2b33320d4fe98ce72faaf62300cc9b0fb86a27eb670da50'; \ + ;; \ + *) 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 + ARG CABAL_INSTALL=3.6.2.0 ARG CABAL_INSTALL_RELEASE_KEY=A970DF3AC3B9709706D74544B3D9F94B8DCAE210 @@ -99,46 +139,6 @@ RUN set -eux; \ \ "/opt/ghc/$GHC/bin/ghc" --version -ARG STACK=2.7.5 -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='9bcd165358d4dcafd2b33320d4fe98ce72faaf62300cc9b0fb86a27eb670da50'; \ - ;; \ - *) 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 - ENV PATH /root/.cabal/bin:/root/.local/bin:/opt/ghc/${GHC}/bin:$PATH CMD ["ghci"] diff --git a/9.2/slim-buster/Dockerfile b/9.2/slim-buster/Dockerfile index 696eba6..eca8b59 100644 --- a/9.2/slim-buster/Dockerfile +++ b/9.2/slim-buster/Dockerfile @@ -23,6 +23,46 @@ RUN apt-get update && \ zlib1g-dev && \ rm -rf /var/lib/apt/lists/* +ARG STACK=2.7.5 +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='9bcd165358d4dcafd2b33320d4fe98ce72faaf62300cc9b0fb86a27eb670da50'; \ + ;; \ + *) 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 + ARG CABAL_INSTALL=3.6.2.0 ARG CABAL_INSTALL_RELEASE_KEY=A970DF3AC3B9709706D74544B3D9F94B8DCAE210 @@ -99,46 +139,6 @@ RUN set -eux; \ \ "/opt/ghc/$GHC/bin/ghc" --version -ARG STACK=2.7.5 -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='9bcd165358d4dcafd2b33320d4fe98ce72faaf62300cc9b0fb86a27eb670da50'; \ - ;; \ - *) 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 - ENV PATH /root/.cabal/bin:/root/.local/bin:/opt/ghc/${GHC}/bin:$PATH CMD ["ghci"]