From 57c974b26e4e7e4cdcda6e9185231d737e2c3ec5 Mon Sep 17 00:00:00 2001 From: Emanuel Borsboom Date: Fri, 22 Dec 2017 15:29:09 -0800 Subject: [PATCH] etc/dockerfiles/stack-build: add lts-10 and remove lts-8 --- .gitlab-ci.yml | 8 +++---- etc/dockerfiles/stack-build/build.sh | 2 +- .../{lts-8.0 => lts-10.0}/Dockerfile | 24 +++++++++++++++---- .../stack-build/lts-9.20/Dockerfile | 2 +- 4 files changed, 25 insertions(+), 11 deletions(-) rename etc/dockerfiles/stack-build/{lts-8.0 => lts-10.0}/Dockerfile (69%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ab5db61ef6..153e1f5d81 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,16 +21,16 @@ build: - (cd etc/scripts && stack --install-ghc install --pedantic) - stack-release-script check -docker_image_lts-8: +docker_image_lts-9: stage: build when: manual script: - docker login -u "$PROD_DOCKER_USERNAME" -p "$PROD_DOCKER_PASSWORD" - - etc/dockerfiles/stack-build/build.sh --push lts-8 + - etc/dockerfiles/stack-build/build.sh --push lts-9 -docker_image_lts-9: +docker_image_lts-10: stage: build when: manual script: - docker login -u "$PROD_DOCKER_USERNAME" -p "$PROD_DOCKER_PASSWORD" - - etc/dockerfiles/stack-build/build.sh --push lts-9 + - etc/dockerfiles/stack-build/build.sh --push lts-10 diff --git a/etc/dockerfiles/stack-build/build.sh b/etc/dockerfiles/stack-build/build.sh index 6060414b6f..5dbb7573e6 100755 --- a/etc/dockerfiles/stack-build/build.sh +++ b/etc/dockerfiles/stack-build/build.sh @@ -130,7 +130,7 @@ if [[ -s "$LTS_SLUG/Dockerfile" ]]; then else # If no exact match, find a dockerfile for any earlier minor version of the - # selected major version, and just create a new tag rom version's image with the selected + # selected major version, and just create a new tag from version's image with the selected # minor version (assuming that nothing needs to change), and push it. minor=$(( LTS_MINOR - 1 )) diff --git a/etc/dockerfiles/stack-build/lts-8.0/Dockerfile b/etc/dockerfiles/stack-build/lts-10.0/Dockerfile similarity index 69% rename from etc/dockerfiles/stack-build/lts-8.0/Dockerfile rename to etc/dockerfiles/stack-build/lts-10.0/Dockerfile index 906e3d9f98..58b479c946 100644 --- a/etc/dockerfiles/stack-build/lts-8.0/Dockerfile +++ b/etc/dockerfiles/stack-build/lts-10.0/Dockerfile @@ -2,9 +2,11 @@ FROM ubuntu:16.04 MAINTAINER Emanuel Borsboom -ARG GHC_VERSION=8.0.2 -ARG LTS_SLUG=lts-8.0 +ARG GHC_VERSION=8.2.2 +ARG LTS_SLUG=lts-10.0 ARG PID1_VERSION=0.1.0.1 +ARG STACK_VERSION=1.6.1 +ARG BOOTSTRAP_COMMIT=a8234cb586c3022099a3b0155275ed067df00f72 ARG DEBIAN_FRONTEND=noninteractive # @@ -22,10 +24,15 @@ ENV LANG=C.UTF-8 \ RUN apt-get update && \ apt-get install -y wget && \ - wget -qO- https://raw.githubusercontent.com/fpco/stackage/93738c5865fdd0627508617215d01b78d4e2bf74/debian-bootstrap.sh | bash && \ - ln -s ghc /opt/ghc/$GHC_VERSION/share/doc/ghc-$GHC_VERSION && \ + wget -qO- https://raw.githubusercontent.com/fpco/stackage/$BOOTSTRAP_COMMIT/debian-bootstrap.sh | bash && \ rm -rf /var/lib/apt/lists/* +# +# Create symlink to help tools find GHC documentation +# + +RUN ln -s ghc /opt/ghc/$GHC_VERSION/share/doc/ghc-$GHC_VERSION + # # Use 'stack' to install basic Haskell tools like alex, happy, and cpphs. We # remove most of the STACK_ROOT afterward to save space, but keep the 'share' @@ -39,12 +46,19 @@ RUN stack --system-ghc --resolver=$LTS_SLUG --local-bin-path=/usr/local/bin inst find . -type d -print0 |sort -rz |xargs -0 rmdir 2>/dev/null || true # -# Install proper 'pid1' init daemon +# Install 'pid1' init daemon # RUN wget -O- "https://github.com/fpco/pid1/releases/download/pid1%2F$PID1_VERSION/pid1-$PID1_VERSION-linux-x86_64.tar.gz" | tar xzf - -C /usr/local && \ chown root:root /usr/local/sbin && \ chown root:root /usr/local/sbin/pid1 + +# +# Install Stack +# + +RUN wget -qO- https://github.com/commercialhaskell/stack/releases/download/v$STACK_VERSION/stack-$STACK_VERSION-linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C /usr/local/bin '*/stack' + # # Set up pid1 entrypoint and default command # diff --git a/etc/dockerfiles/stack-build/lts-9.20/Dockerfile b/etc/dockerfiles/stack-build/lts-9.20/Dockerfile index b3988eddeb..b524e98052 100644 --- a/etc/dockerfiles/stack-build/lts-9.20/Dockerfile +++ b/etc/dockerfiles/stack-build/lts-9.20/Dockerfile @@ -1,3 +1,3 @@ FROM fpco/stack-build:lts-9.0 ARG STACK_VERSION=1.6.1 -RUN curl -sSL https://github.com/commercialhaskell/stack/releases/download/v$STACK_VERSION/stack-$STACK_VERSION-linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C /usr/local/bin '*/stack' +RUN wget -qO- https://github.com/commercialhaskell/stack/releases/download/v$STACK_VERSION/stack-$STACK_VERSION-linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C /usr/local/bin '*/stack'