diff --git a/automated/build.sh b/automated/build.sh index d6fdd77e..5815fe4f 100755 --- a/automated/build.sh +++ b/automated/build.sh @@ -145,6 +145,15 @@ docker run $ARGS_UPLOAD $IMAGE /bin/bash -c "curator upload-docs --target $TARGE docker run $ARGS_UPLOAD $IMAGE curator legacy-bulk --stackage-snapshots /dot-stackage/curator/stackage-snapshots/ --lts-haskell /dot-stackage/curator/lts-haskell/ --stackage-nightly /dot-stackage/curator/stackage-nightly/ +# Build and push docker image fpco/stack-build & fpco/stack-build-small for current release + +if [ $SHORTNAME = "lts" ] +then + $ROOT/dockerfiles/build.sh $TARGET + $ROOT/dockerfiles/build.sh --push $TARGET + $ROOT/dockerfiles/build.sh --push --small $TARGET +fi + ( if [ $SHORTNAME = "lts" ] then diff --git a/automated/dockerfiles/README.md b/automated/dockerfiles/README.md new file mode 100644 index 00000000..9fd65199 --- /dev/null +++ b/automated/dockerfiles/README.md @@ -0,0 +1,33 @@ +dockerfiles/stack-build +======================= + +Build [fpco/stack-build](https://hub.docker.com/r/fpco/stack-build/) Docker +images. This script and its Dockerfiles are used for building images for LTS >= +8.0. + +Usage +----- + + ./build.sh [--push] [--dry-run] [--small] lts-X.Y" + +Options +------- + +`--help`: show this help + +`--push`: push the image after building/tagging it + +`--dry-run`: print the important commands that will be run, but don't actually + run them + +`--small`: build the small variant of the image + +Argument +--------- + +The image for the selected LTS version will be built. + +This searches for a Dockerfile for the selected snapshot in +`lts-X.Y/Dockerfile`, and if one isn't found reuses the same image as built the +most recent `lts-X.Y/Dockerfile` found for earlier minor versions of the same +major version. diff --git a/automated/dockerfiles/build.sh b/automated/dockerfiles/build.sh new file mode 100755 index 00000000..d80d4823 --- /dev/null +++ b/automated/dockerfiles/build.sh @@ -0,0 +1,136 @@ +#!/usr/bin/env bash + +set -eu +cd "$(dirname "$0")" + +# +# Constants and defaults +# + +DOCKER_REPO=fpco/stack-build +PUSH=false +DRY=false +VARIANT=build + +# +# Functions +# + +# Print usage information and exit with failure status. First argument is an +# error message. +usage() { + echo "$0: $1" >&2 + echo + echo "Usage: $0 [--push] [--dry-run] [--small] lts-X.Y]" + echo "See README.md for more information." + echo + exit 1 +} + +# Print a command, and if --dry-run disabled also run it +dry() { + echo ">>> $*" + [[ $DRY = true ]] || "$@" +} + +# Push an image if --push is enabled (otherwise do nothing) +push() { + [[ $PUSH = false ]] || dry docker push "$1" +} + +# Tag an image, and then push it if --push is enabled +tagpush() { + dry docker tag "$1" "$2" + push "$2" +} + +# +# Parse command-line +# + +LTS_SLUG_ARG= +while [[ $# -gt 0 ]]; do + case "$1" in + --push) + PUSH=true + shift + ;; + --dry-run) + DRY=true + shift + ;; + --small) + VARIANT=small + DOCKER_REPO=fpco/stack-build-small + shift + ;; + -*) + usage "Unknown option: $1" + ;; + *) + if [[ -n "$LTS_SLUG_ARG" ]]; then + usage "Cannot specify multiple snaphots: $1" + fi + LTS_SLUG_ARG="$1" + shift + ;; + esac +done + +case "$LTS_SLUG_ARG" in + "") + usage "Missing argument: snapshot" + ;; + lts-*.*) + LTS_SLUG="$LTS_SLUG_ARG" + ;; + *) + echo "$0: Wrong snapshot format: $LTS_SLUG_ARG" >&2 + exit 1 + ;; +esac + +LTS_VERSION="${LTS_SLUG#lts-}" +LTS_MAJOR="${LTS_VERSION%.*}" +LTS_MINOR="${LTS_VERSION#*.}" + +# +# Find the Dockerfile for the selected snapshot +# + +if [[ -s "$LTS_SLUG/Dockerfile" ]]; then + + # If there is an exact match, build and push that image + + sed "s/\\\$DOCKER_REPO/$(echo $DOCKER_REPO|sed 's/\//\\\//')/g" "$LTS_SLUG/Dockerfile" >"$LTS_SLUG/Dockerfile.sub" + dry docker build -t "$DOCKER_REPO:$LTS_SLUG" --build-arg "DOCKER_REPO=$DOCKER_REPO" --build-arg "LTS_SLUG=$LTS_SLUG" --build-arg "VARIANT=$VARIANT" -f "$LTS_SLUG/Dockerfile.sub" "$LTS_SLUG" + rm -f "$LTS_SLUG/Dockerfile.sub" + push "$DOCKER_REPO:$LTS_SLUG" +else + + # If no exact match, find a dockerfile for any earlier minor version of the + # 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 )) + while [[ ! -s "lts-$LTS_MAJOR.$minor/Dockerfile" && $minor -ge 0 ]]; do + minor=$(( minor - 1 )) + done + if [[ $minor -lt 0 ]]; then + echo "$0: Cannot find any Dockerfile for LTS major version" >&2 + exit 1 + fi + dry docker pull "$DOCKER_REPO:lts-$LTS_MAJOR.$minor" || true + tagpush "$DOCKER_REPO:lts-$LTS_MAJOR.$minor" "$DOCKER_REPO:$LTS_SLUG" +fi + +# +# Create and push additional tags +# + +# Create and push an 'lts-X' tag. +tagpush "$DOCKER_REPO:$LTS_SLUG" "$DOCKER_REPO:lts-$LTS_MAJOR" + +# Create and push the 'lts' and 'latest' tags. +tagpush "$DOCKER_REPO:$LTS_SLUG" "$DOCKER_REPO:lts" +tagpush "$DOCKER_REPO:$LTS_SLUG" "$DOCKER_REPO:latest" diff --git a/automated/dockerfiles/lts-10.0/Dockerfile b/automated/dockerfiles/lts-10.0/Dockerfile new file mode 100644 index 00000000..7a0b4172 --- /dev/null +++ b/automated/dockerfiles/lts-10.0/Dockerfile @@ -0,0 +1,67 @@ +FROM ubuntu:16.04 + +MAINTAINER Emanuel Borsboom + +ARG GHC_VERSION=8.2.2 +ARG LTS_SLUG=lts-10.0 +ARG PID1_VERSION=0.1.0.1 +ARG STACK_VERSION=1.6.3 +ARG BOOTSTRAP_COMMIT=a8234cb586c3022099a3b0155275ed067df00f72 +ARG DEBIAN_FRONTEND=noninteractive + +# +# Set encoding to UTF-8 and PATH to find GHC and cabal/stack-installed binaries. +# + +ENV LANG=C.UTF-8 \ + LC_ALL=C.UTF-8 \ + PATH=/root/.cabal/bin:/root/.local/bin:/opt/ghc/$GHC_VERSION/bin:$PATH + +# +# Use Stackage's debian-bootstrap.sh script to install system libraries and +# tools required to build any Stackage package. +# + +RUN apt-get update && \ + apt-get install -y wget && \ + 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' +# files that some of these tools require. +# + +RUN stack --system-ghc --resolver=$LTS_SLUG --local-bin-path=/usr/local/bin install \ + cabal-install happy alex cpphs gtk2hs-buildtools hscolour && \ + cd $HOME/.stack && \ + find . -type f -not -path './snapshots/*/share/*' -exec rm '{}' \; && \ + find . -type d -print0 |sort -rz |xargs -0 rmdir 2>/dev/null || true + +# +# 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 +# + +ENTRYPOINT ["/usr/local/sbin/pid1"] +CMD ["bash"] diff --git a/automated/dockerfiles/lts-10.1/Dockerfile b/automated/dockerfiles/lts-10.1/Dockerfile new file mode 100644 index 00000000..3ffce11c --- /dev/null +++ b/automated/dockerfiles/lts-10.1/Dockerfile @@ -0,0 +1,3 @@ +FROM fpco/stack-build:lts-10.0 +ARG STACK_VERSION=1.6.3 +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' diff --git a/automated/dockerfiles/lts-10.5/Dockerfile b/automated/dockerfiles/lts-10.5/Dockerfile new file mode 100644 index 00000000..d2e8ba14 --- /dev/null +++ b/automated/dockerfiles/lts-10.5/Dockerfile @@ -0,0 +1,3 @@ +FROM fpco/stack-build:lts-10.0 +ARG STACK_VERSION=1.6.5 +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' diff --git a/automated/dockerfiles/lts-11.0/Dockerfile b/automated/dockerfiles/lts-11.0/Dockerfile new file mode 100644 index 00000000..093286da --- /dev/null +++ b/automated/dockerfiles/lts-11.0/Dockerfile @@ -0,0 +1,67 @@ +FROM ubuntu:16.04 + +MAINTAINER Emanuel Borsboom + +ARG GHC_VERSION=8.2.2 +ARG LTS_SLUG=lts-11.0 +ARG PID1_VERSION=0.1.0.1 +ARG STACK_VERSION=1.6.5 +ARG BOOTSTRAP_COMMIT=13ab2b86779c98598e96af7f4c4b9653ba280be5 +ARG DEBIAN_FRONTEND=noninteractive + +# +# Set encoding to UTF-8 and PATH to find GHC and cabal/stack-installed binaries. +# + +ENV LANG=C.UTF-8 \ + LC_ALL=C.UTF-8 \ + PATH=/root/.cabal/bin:/root/.local/bin:/opt/ghc/$GHC_VERSION/bin:$PATH + +# +# Use Stackage's debian-bootstrap.sh script to install system libraries and +# tools required to build any Stackage package. +# + +RUN apt-get update && \ + apt-get install -y wget && \ + 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' +# files that some of these tools require. +# + +RUN stack --system-ghc --resolver=$LTS_SLUG --local-bin-path=/usr/local/bin install \ + cabal-install happy alex cpphs gtk2hs-buildtools hscolour && \ + cd $HOME/.stack && \ + find . -type f -not -path './snapshots/*/share/*' -exec rm '{}' \; && \ + find . -type d -print0 |sort -rz |xargs -0 rmdir 2>/dev/null || true + +# +# 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 +# + +ENTRYPOINT ["/usr/local/sbin/pid1"] +CMD ["bash"] diff --git a/automated/dockerfiles/lts-11.22/Dockerfile b/automated/dockerfiles/lts-11.22/Dockerfile new file mode 100644 index 00000000..b2065306 --- /dev/null +++ b/automated/dockerfiles/lts-11.22/Dockerfile @@ -0,0 +1,3 @@ +FROM fpco/stack-build:lts-11.6 +ARG STACK_VERSION=1.9.3 +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' diff --git a/automated/dockerfiles/lts-11.6/Dockerfile b/automated/dockerfiles/lts-11.6/Dockerfile new file mode 100644 index 00000000..83c5d691 --- /dev/null +++ b/automated/dockerfiles/lts-11.6/Dockerfile @@ -0,0 +1,3 @@ +FROM fpco/stack-build:lts-11.5 +ARG STACK_VERSION=1.7.1 +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' diff --git a/automated/dockerfiles/lts-12.0/Dockerfile b/automated/dockerfiles/lts-12.0/Dockerfile new file mode 100644 index 00000000..827941ee --- /dev/null +++ b/automated/dockerfiles/lts-12.0/Dockerfile @@ -0,0 +1,69 @@ +FROM ubuntu:16.04 + +MAINTAINER Emanuel Borsboom + +ARG GHC_VERSION=8.4.3 +ARG LTS_SLUG=lts-12.0 +ARG PID1_VERSION=0.1.2.0 +ARG STACK_VERSION=1.7.1 +ARG CUDA_VERSION=8.0 +ARG BOOTSTRAP_COMMIT=56c62ccbf31229ee2b09d3a0b4cd2ad94e7406a8 +ARG DEBIAN_FRONTEND=noninteractive + +# +# Set encoding to UTF-8 and PATH to find GHC and cabal/stack-installed binaries. +# + +ENV LANG=C.UTF-8 \ + LC_ALL=C.UTF-8 \ + PATH=/root/.cabal/bin:/root/.local/bin:/usr/local/cuda-$CUDA_VERSION/bin:/opt/ghc/$GHC_VERSION/bin:$PATH \ + CUDA_PATH=/usr/local/cuda-$CUDA_VERSION \ + LD_LIBRARY_PATH=/usr/local/cuda-$CUDA_VERSION/lib64:/usr/local/cuda-$CUDA_VERSION/nvvm/lib64 +# +# Use Stackage's debian-bootstrap.sh script to install system libraries and +# tools required to build any Stackage package. +# + +RUN apt-get update && \ + apt-get install -y wget && \ + 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' +# files that some of these tools require. +# + +RUN stack --system-ghc --resolver=$LTS_SLUG --local-bin-path=/usr/local/bin install \ + cabal-install happy alex cpphs gtk2hs-buildtools hscolour && \ + cd $HOME/.stack && \ + find . -type f -not -path './snapshots/*/share/*' -exec rm '{}' \; && \ + find . -type d -print0 |sort -rz |xargs -0 rmdir 2>/dev/null || true + +# +# Install 'pid1' init daemon +# + +RUN wget -O- "https://github.com/fpco/pid1/releases/download/v$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 +# + +ENTRYPOINT ["/usr/local/sbin/pid1"] +CMD ["bash"] diff --git a/automated/dockerfiles/lts-12.13/Dockerfile b/automated/dockerfiles/lts-12.13/Dockerfile new file mode 100644 index 00000000..23617aa9 --- /dev/null +++ b/automated/dockerfiles/lts-12.13/Dockerfile @@ -0,0 +1,3 @@ +FROM fpco/stack-build:lts-12.0 +ARG STACK_VERSION=1.9.1 +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' diff --git a/automated/dockerfiles/lts-12.15/Dockerfile b/automated/dockerfiles/lts-12.15/Dockerfile new file mode 100644 index 00000000..7d309271 --- /dev/null +++ b/automated/dockerfiles/lts-12.15/Dockerfile @@ -0,0 +1,14 @@ +FROM fpco/stack-build:lts-12.0 +ARG STACK_VERSION=1.9.1 +ARG GHC_VERSION=8.4.4 +RUN apt-get update && \ + apt-get install -y \ + ghc-$GHC_VERSION \ + ghc-$GHC_VERSION-dyn \ + ghc-$GHC_VERSION-htmldocs \ + ghc-$GHC_VERSION-prof && \ + rm -rf /var/lib/apt/lists/* +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' +RUN ln -s ghc-$GHC_VERSION /opt/ghc/$GHC_VERSION/share/doc/ghc +ARG CUDA_VERSION=8.0 +ENV PATH=/root/.cabal/bin:/root/.local/bin:/usr/local/cuda-$CUDA_VERSION/bin:/opt/ghc/$GHC_VERSION/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin diff --git a/automated/dockerfiles/lts-12.21/Dockerfile b/automated/dockerfiles/lts-12.21/Dockerfile new file mode 100644 index 00000000..b8f3e821 --- /dev/null +++ b/automated/dockerfiles/lts-12.21/Dockerfile @@ -0,0 +1,3 @@ +FROM fpco/stack-build:lts-12.15 +ARG STACK_VERSION=1.9.3 +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' diff --git a/automated/dockerfiles/lts-12.26/Dockerfile b/automated/dockerfiles/lts-12.26/Dockerfile new file mode 100644 index 00000000..edaab49b --- /dev/null +++ b/automated/dockerfiles/lts-12.26/Dockerfile @@ -0,0 +1,89 @@ +FROM ubuntu:16.04 + +MAINTAINER Emanuel Borsboom + +ARG GHC_VERSION=8.4.4 +ARG LTS_SLUG=lts-12.0 +ARG PID1_VERSION=0.1.2.0 +ARG STACK_VERSION=1.9.3 +ARG CUDA_VERSION=8.0 +ARG BOOTSTRAP_COMMIT=7f982f63a3734ddb2a7cbbc52b8cec983c496efa +ARG DEBIAN_FRONTEND=noninteractive +ARG VARIANT=build + +# +# Set encoding to UTF-8 and PATH to find GHC and cabal/stack-installed binaries. +# + +ENV LANG=C.UTF-8 \ + LC_ALL=C.UTF-8 \ + PATH=/root/.cabal/bin:/root/.local/bin:/usr/local/cuda-$CUDA_VERSION/bin:/opt/ghc/$GHC_VERSION/bin:$PATH \ + CUDA_PATH=/usr/local/cuda-$CUDA_VERSION \ + LD_LIBRARY_PATH=/usr/local/cuda-$CUDA_VERSION/lib64:/usr/local/cuda-$CUDA_VERSION/nvvm/lib64 +# +# Use Stackage's debian-bootstrap.sh script to install system libraries and +# tools required to build any Stackage package. +# + +RUN apt-get update && \ + apt-get install -y --no-install-recommends wget netbase ca-certificates && \ + if [ "$VARIANT" = "small" ]; then \ + echo "deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main" >>/etc/apt/sources.list && \ + echo "deb-src http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main" >>/etc/apt/sources.list && \ + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 063DAB2BDC0B3F9FCEBC378BFF3AEACEF6F88286 && \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + ghc-$GHC_VERSION ghc-$GHC_VERSION-htmldocs \ + g++ gcc libc6-dev libffi-dev libgmp-dev make xz-utils zlib1g-dev git gnupg \ + libtinfo-dev; \ + else \ + wget -qO- https://raw.githubusercontent.com/fpco/stackage/$BOOTSTRAP_COMMIT/debian-bootstrap.sh | bash; \ + fi && \ + 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 + +# +# 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' + +# +# Configure Stack to use the GHC installed in the Docker image rather than installing its own +# + +RUN mkdir /etc/stack/ && \ + echo "system-ghc: true" >/etc/stack/config.yaml + +# +# 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' +# files that some of these tools require. +# + +RUN export STACK_ROOT=/usr/local/lib/stack && \ + stack --resolver=$LTS_SLUG --local-bin-path=/usr/local/bin install \ + cabal-install happy alex cpphs gtk2hs-buildtools hscolour hlint hindent && \ + cd $STACK_ROOT && \ + find . -type f -not -path './snapshots/*/share/*' -exec rm '{}' \; && \ + find . -type d -print0 |sort -rz |xargs -0 rmdir 2>/dev/null || true + +# +# Install 'pid1' init daemon +# + +RUN wget -O- "https://github.com/fpco/pid1/releases/download/v$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 + +# +# Set up pid1 entrypoint and default command +# + +ENTRYPOINT ["/usr/local/sbin/pid1"] +CMD ["bash"] diff --git a/automated/dockerfiles/lts-13.0/Dockerfile b/automated/dockerfiles/lts-13.0/Dockerfile new file mode 100644 index 00000000..3fc6836c --- /dev/null +++ b/automated/dockerfiles/lts-13.0/Dockerfile @@ -0,0 +1,69 @@ +FROM ubuntu:16.04 + +MAINTAINER Emanuel Borsboom + +ARG GHC_VERSION=8.6.3 +ARG LTS_SLUG=lts-13.0 +ARG PID1_VERSION=0.1.2.0 +ARG STACK_VERSION=1.9.3 +ARG CUDA_VERSION=10.0 +ARG BOOTSTRAP_COMMIT=26b29f2862462afd47fb916ed0a2c2a6844ebca9 +ARG DEBIAN_FRONTEND=noninteractive + +# +# Set encoding to UTF-8 and PATH to find GHC and cabal/stack-installed binaries. +# + +ENV LANG=C.UTF-8 \ + LC_ALL=C.UTF-8 \ + PATH=/root/.cabal/bin:/root/.local/bin:/usr/local/cuda-$CUDA_VERSION/bin:/opt/ghc/$GHC_VERSION/bin:$PATH \ + CUDA_PATH=/usr/local/cuda-$CUDA_VERSION \ + LD_LIBRARY_PATH=/usr/local/cuda-$CUDA_VERSION/lib64:/usr/local/cuda-$CUDA_VERSION/nvvm/lib64 +# +# Use Stackage's debian-bootstrap.sh script to install system libraries and +# tools required to build any Stackage package. +# + +RUN apt-get update && \ + apt-get install -y wget && \ + 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' +# files that some of these tools require. +# + +RUN stack --system-ghc --resolver=$LTS_SLUG --local-bin-path=/usr/local/bin install \ + cabal-install happy alex cpphs gtk2hs-buildtools hscolour && \ + cd $HOME/.stack && \ + find . -type f -not -path './snapshots/*/share/*' -exec rm '{}' \; && \ + find . -type d -print0 |sort -rz |xargs -0 rmdir 2>/dev/null || true + +# +# Install 'pid1' init daemon +# + +RUN wget -O- "https://github.com/fpco/pid1/releases/download/v$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 +# + +ENTRYPOINT ["/usr/local/sbin/pid1"] +CMD ["bash"] diff --git a/automated/dockerfiles/lts-13.12/Dockerfile b/automated/dockerfiles/lts-13.12/Dockerfile new file mode 100644 index 00000000..c85a6eba --- /dev/null +++ b/automated/dockerfiles/lts-13.12/Dockerfile @@ -0,0 +1,93 @@ +FROM ubuntu:16.04 + +MAINTAINER Emanuel Borsboom + +ARG GHC_VERSION=8.6.4 +ARG LTS_SLUG=lts-13.11 +ARG PID1_VERSION=0.1.2.0 +ARG STACK_VERSION=1.9.3 +ARG CUDA_VERSION=10.0 +ARG BOOTSTRAP_COMMIT=9f2b7ab95c711794257b059604e80ab9ad3c0c45 +ARG DEBIAN_FRONTEND=noninteractive +ARG VARIANT=build + +# +# Set encoding to UTF-8 and PATH to find GHC and cabal/stack-installed binaries. +# + +ENV LANG=C.UTF-8 \ + LC_ALL=C.UTF-8 \ + PATH=/root/.cabal/bin:/root/.local/bin:/usr/local/cuda-$CUDA_VERSION/bin:/opt/ghc/$GHC_VERSION/bin:$PATH \ + CUDA_PATH=/usr/local/cuda-$CUDA_VERSION \ + LD_LIBRARY_PATH=/usr/local/cuda-$CUDA_VERSION/lib64:/usr/local/cuda-$CUDA_VERSION/nvvm/lib64 + +# +# Use Stackage's debian-bootstrap.sh script to install system libraries and +# tools required to build any Stackage package. +# + +RUN apt-get update && \ + apt-get install -y --no-install-recommends wget netbase ca-certificates && \ + if [ "$VARIANT" = "small" ]; then \ + echo "deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main" >>/etc/apt/sources.list && \ + echo "deb-src http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main" >>/etc/apt/sources.list && \ + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 063DAB2BDC0B3F9FCEBC378BFF3AEACEF6F88286 && \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + ghc-$GHC_VERSION ghc-$GHC_VERSION-htmldocs \ + g++ gcc libc6-dev libffi-dev libgmp-dev make xz-utils zlib1g-dev git gnupg \ + libtinfo-dev; \ + else \ + wget -qO- https://raw.githubusercontent.com/fpco/stackage/$BOOTSTRAP_COMMIT/debian-bootstrap.sh | sed "s/^GHCVER=8.6.3$/GHCVER=$GHC_VERSION/" | bash && \ + # Add g++ version required for building 'double-conversion' \ + # (see https://github.com/commercialhaskell/stack/issues/4470) \ + apt-get install -y g++-7; \ + fi && \ + 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 + +# +# 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' + +# +# Configure Stack to use the GHC installed in the Docker image rather than installing its own +# + +RUN mkdir /etc/stack/ && \ + echo "system-ghc: true" >/etc/stack/config.yaml + +# +# 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' +# files that some of these tools require. +# + +RUN export STACK_ROOT=/usr/local/lib/stack && \ + stack --resolver=$LTS_SLUG --local-bin-path=/usr/local/bin install \ + cabal-install happy alex cpphs gtk2hs-buildtools hscolour hlint hindent && \ + cd $STACK_ROOT && \ + find . -type f -not -path './snapshots/*/share/*' -exec rm '{}' \; && \ + find . -type d -print0 |sort -rz |xargs -0 rmdir 2>/dev/null || true + +# +# Install 'pid1' init daemon +# + +RUN wget -O- "https://github.com/fpco/pid1/releases/download/v$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 + +# +# Set up pid1 entrypoint and default command +# + +ENTRYPOINT ["/usr/local/sbin/pid1"] +CMD ["bash"] diff --git a/automated/dockerfiles/lts-13.20/Dockerfile b/automated/dockerfiles/lts-13.20/Dockerfile new file mode 100644 index 00000000..0ac78fcb --- /dev/null +++ b/automated/dockerfiles/lts-13.20/Dockerfile @@ -0,0 +1,93 @@ +FROM ubuntu:16.04 + +MAINTAINER Emanuel Borsboom + +ARG GHC_VERSION=8.6.5 +ARG LTS_SLUG=lts-13.20 +ARG PID1_VERSION=0.1.2.0 +ARG STACK_VERSION=1.9.3 +ARG CUDA_VERSION=10.0 +ARG BOOTSTRAP_COMMIT=9f2b7ab95c711794257b059604e80ab9ad3c0c45 +ARG DEBIAN_FRONTEND=noninteractive +ARG VARIANT=build + +# +# Set encoding to UTF-8 and PATH to find GHC and cabal/stack-installed binaries. +# + +ENV LANG=C.UTF-8 \ + LC_ALL=C.UTF-8 \ + PATH=/root/.cabal/bin:/root/.local/bin:/usr/local/cuda-$CUDA_VERSION/bin:/opt/ghc/$GHC_VERSION/bin:$PATH \ + CUDA_PATH=/usr/local/cuda-$CUDA_VERSION \ + LD_LIBRARY_PATH=/usr/local/cuda-$CUDA_VERSION/lib64:/usr/local/cuda-$CUDA_VERSION/nvvm/lib64 + +# +# Use Stackage's debian-bootstrap.sh script to install system libraries and +# tools required to build any Stackage package. +# + +RUN apt-get update && \ + apt-get install -y --no-install-recommends wget netbase ca-certificates && \ + if [ "$VARIANT" = "small" ]; then \ + echo "deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main" >>/etc/apt/sources.list && \ + echo "deb-src http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main" >>/etc/apt/sources.list && \ + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 063DAB2BDC0B3F9FCEBC378BFF3AEACEF6F88286 && \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + ghc-$GHC_VERSION ghc-$GHC_VERSION-htmldocs \ + g++ gcc libc6-dev libffi-dev libgmp-dev make xz-utils zlib1g-dev git gnupg \ + libtinfo-dev; \ + else \ + wget -qO- https://raw.githubusercontent.com/fpco/stackage/$BOOTSTRAP_COMMIT/debian-bootstrap.sh | sed "s/^GHCVER=8.6.3$/GHCVER=$GHC_VERSION/" | bash && \ + # Add g++ version required for building 'double-conversion' \ + # (see https://github.com/commercialhaskell/stack/issues/4470) \ + apt-get install -y g++-7; \ + fi && \ + 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 + +# +# 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' + +# +# Configure Stack to use the GHC installed in the Docker image rather than installing its own +# + +RUN mkdir /etc/stack/ && \ + echo "system-ghc: true" >/etc/stack/config.yaml + +# +# 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' +# files that some of these tools require. +# + +RUN export STACK_ROOT=/usr/local/lib/stack && \ + stack --resolver=$LTS_SLUG --local-bin-path=/usr/local/bin install \ + cabal-install happy alex cpphs gtk2hs-buildtools hscolour hlint hindent && \ + cd $STACK_ROOT && \ + find . -type f -not -path './snapshots/*/share/*' -exec rm '{}' \; && \ + find . -type d -print0 |sort -rz |xargs -0 rmdir 2>/dev/null || true + +# +# Install 'pid1' init daemon +# + +RUN wget -O- "https://github.com/fpco/pid1/releases/download/v$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 + +# +# Set up pid1 entrypoint and default command +# + +ENTRYPOINT ["/usr/local/sbin/pid1"] +CMD ["bash"] diff --git a/automated/dockerfiles/lts-13.25/Dockerfile b/automated/dockerfiles/lts-13.25/Dockerfile new file mode 100644 index 00000000..94e2439c --- /dev/null +++ b/automated/dockerfiles/lts-13.25/Dockerfile @@ -0,0 +1,3 @@ +FROM $DOCKER_REPO:lts-13.24 +ARG STACK_VERSION=2.1.1 +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' diff --git a/automated/dockerfiles/lts-13.27/Dockerfile b/automated/dockerfiles/lts-13.27/Dockerfile new file mode 100644 index 00000000..a8d1204e --- /dev/null +++ b/automated/dockerfiles/lts-13.27/Dockerfile @@ -0,0 +1,9 @@ +FROM $DOCKER_REPO:lts-13.26 +ARG VARIANT +RUN if [ "$VARIANT" = "small" ]; then \ + apt-get update && \ + apt-get install -y --no-install-recommends sudo && \ + rm -rf /var/lib/apt/lists/*; \ + fi +ARG STACK_VERSION=2.1.3 +RUN wget -qO- https://github.com/commercialhaskell/stack/releases/download/v$STACK_VERSION/stack-$STACK_VERSION-linux-x86_64-static.tar.gz | tar xz --wildcards --strip-components=1 -C /usr/local/bin '*/stack' diff --git a/automated/dockerfiles/lts-13.3/Dockerfile b/automated/dockerfiles/lts-13.3/Dockerfile new file mode 100644 index 00000000..78e92de7 --- /dev/null +++ b/automated/dockerfiles/lts-13.3/Dockerfile @@ -0,0 +1,10 @@ +FROM fpco/stack-build:lts-13.0 + +# +# Add g++ version required for building 'double-conversion' +# (see https://github.com/commercialhaskell/stack/issues/4470) +# + +RUN apt-get update && \ + apt-get install -y g++-7 && \ + rm -rf /var/lib/apt/lists/* diff --git a/automated/dockerfiles/lts-14.0/Dockerfile b/automated/dockerfiles/lts-14.0/Dockerfile new file mode 100644 index 00000000..9905a75d --- /dev/null +++ b/automated/dockerfiles/lts-14.0/Dockerfile @@ -0,0 +1,89 @@ +FROM ubuntu:18.04 + +LABEL maintainer="manny@fpcomplete.com" + +ARG GHC_VERSION=8.6.5 +ARG LTS_SLUG=lts-14.0 +ARG PID1_VERSION=0.1.2.0 +ARG STACK_VERSION=2.1.3 +ARG CUDA_VERSION=10.0 +ARG JVM_PATH=/usr/lib/jvm/java-8-openjdk-amd64 +ARG LLVM_VERSION=3.9 +ARG BOOTSTRAP_COMMIT=d4143f1845f26e8e99d0a1a8134d6ff535ab98b2 +ARG DEBIAN_FRONTEND=noninteractive +ARG VARIANT=build +ARG STACK_ROOT=/home/stackage/.stack + +# +# Set encoding to UTF-8 and PATH to find GHC and cabal/stack-installed binaries. +# + +ENV LANG=C.UTF-8 \ + LC_ALL=C.UTF-8 \ + PATH=/root/.local/bin:/usr/local/cuda-$CUDA_VERSION/bin:$STACK_ROOT/programs/x86_64-linux/ghc-$GHC_VERSION/bin:$PATH \ + CUDA_PATH=/usr/local/cuda-$CUDA_VERSION \ + CPATH=$JVM_PATH/include:$JVM_PATH/include/linux:/usr/lib/llvm-$LLVM_VERSION/include + +# +# Install pre-requisites +# + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + wget netbase ca-certificates g++ gcc libc6-dev libffi-dev libgmp-dev \ + make xz-utils zlib1g-dev git gnupg libtinfo-dev && \ + rm -rf /var/lib/apt/lists/* + +# +# Use Stackage's debian-bootstrap.sh script to install system libraries and +# tools required to build any Stackage package. +# Re-installs 'stack' *after* running debian-bootstrap.sh since that may have +# installed a different version. +# In the case of 'small' image, just install Stack and GHC. +# + +RUN if [ "$VARIANT" != "small" ]; then \ + wget -qO- https://raw.githubusercontent.com/fpco/stackage/$BOOTSTRAP_COMMIT/debian-bootstrap.sh | sed "s/^GHCVER=8.6.5$/GHCVER=$GHC_VERSION/" | GHCVER=$GHC_VERSION bash; \ + fi && \ + 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/bin '*/stack' && \ + if [ "$VARIANT" = "small" ]; then \ + stack setup --resolver ghc-$GHC_VERSION; \ + fi && \ + rm -rf /var/lib/apt/lists/* && \ + cd $STACK_ROOT && \ + find . -type f -not -path "./programs/x86_64-linux/ghc-$GHC_VERSION/*" -exec rm '{}' \; && \ + find . -type d -print0 |sort -rz |xargs -0 rmdir 2>/dev/null || true + +# +# Configure Stack to use the GHC installed in the Docker image rather than installing its own +# + +RUN mkdir /etc/stack/ && \ + echo "system-ghc: true" >/etc/stack/config.yaml + +# +# 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' +# files that some of these tools require. +# + +RUN stack --resolver=$LTS_SLUG --local-bin-path=/usr/bin install \ + happy alex cpphs gtk2hs-buildtools hscolour hlint hindent && \ + cd $STACK_ROOT && \ + find . -type f -not -path './snapshots/*/share/*' -and -not -path "./programs/x86_64-linux/ghc-$GHC_VERSION/*" -exec rm '{}' \; && \ + find . -type d -print0 |sort -rz |xargs -0 rmdir 2>/dev/null || true + +# +# Install 'pid1' init daemon +# + +RUN wget -O- "https://github.com/fpco/pid1/releases/download/v$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 + +# +# Set up pid1 entrypoint and default command +# + +ENTRYPOINT ["/usr/local/sbin/pid1"] +CMD ["bash"] diff --git a/automated/dockerfiles/lts-14.0/Dockerfile.sub b/automated/dockerfiles/lts-14.0/Dockerfile.sub new file mode 100644 index 00000000..9905a75d --- /dev/null +++ b/automated/dockerfiles/lts-14.0/Dockerfile.sub @@ -0,0 +1,89 @@ +FROM ubuntu:18.04 + +LABEL maintainer="manny@fpcomplete.com" + +ARG GHC_VERSION=8.6.5 +ARG LTS_SLUG=lts-14.0 +ARG PID1_VERSION=0.1.2.0 +ARG STACK_VERSION=2.1.3 +ARG CUDA_VERSION=10.0 +ARG JVM_PATH=/usr/lib/jvm/java-8-openjdk-amd64 +ARG LLVM_VERSION=3.9 +ARG BOOTSTRAP_COMMIT=d4143f1845f26e8e99d0a1a8134d6ff535ab98b2 +ARG DEBIAN_FRONTEND=noninteractive +ARG VARIANT=build +ARG STACK_ROOT=/home/stackage/.stack + +# +# Set encoding to UTF-8 and PATH to find GHC and cabal/stack-installed binaries. +# + +ENV LANG=C.UTF-8 \ + LC_ALL=C.UTF-8 \ + PATH=/root/.local/bin:/usr/local/cuda-$CUDA_VERSION/bin:$STACK_ROOT/programs/x86_64-linux/ghc-$GHC_VERSION/bin:$PATH \ + CUDA_PATH=/usr/local/cuda-$CUDA_VERSION \ + CPATH=$JVM_PATH/include:$JVM_PATH/include/linux:/usr/lib/llvm-$LLVM_VERSION/include + +# +# Install pre-requisites +# + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + wget netbase ca-certificates g++ gcc libc6-dev libffi-dev libgmp-dev \ + make xz-utils zlib1g-dev git gnupg libtinfo-dev && \ + rm -rf /var/lib/apt/lists/* + +# +# Use Stackage's debian-bootstrap.sh script to install system libraries and +# tools required to build any Stackage package. +# Re-installs 'stack' *after* running debian-bootstrap.sh since that may have +# installed a different version. +# In the case of 'small' image, just install Stack and GHC. +# + +RUN if [ "$VARIANT" != "small" ]; then \ + wget -qO- https://raw.githubusercontent.com/fpco/stackage/$BOOTSTRAP_COMMIT/debian-bootstrap.sh | sed "s/^GHCVER=8.6.5$/GHCVER=$GHC_VERSION/" | GHCVER=$GHC_VERSION bash; \ + fi && \ + 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/bin '*/stack' && \ + if [ "$VARIANT" = "small" ]; then \ + stack setup --resolver ghc-$GHC_VERSION; \ + fi && \ + rm -rf /var/lib/apt/lists/* && \ + cd $STACK_ROOT && \ + find . -type f -not -path "./programs/x86_64-linux/ghc-$GHC_VERSION/*" -exec rm '{}' \; && \ + find . -type d -print0 |sort -rz |xargs -0 rmdir 2>/dev/null || true + +# +# Configure Stack to use the GHC installed in the Docker image rather than installing its own +# + +RUN mkdir /etc/stack/ && \ + echo "system-ghc: true" >/etc/stack/config.yaml + +# +# 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' +# files that some of these tools require. +# + +RUN stack --resolver=$LTS_SLUG --local-bin-path=/usr/bin install \ + happy alex cpphs gtk2hs-buildtools hscolour hlint hindent && \ + cd $STACK_ROOT && \ + find . -type f -not -path './snapshots/*/share/*' -and -not -path "./programs/x86_64-linux/ghc-$GHC_VERSION/*" -exec rm '{}' \; && \ + find . -type d -print0 |sort -rz |xargs -0 rmdir 2>/dev/null || true + +# +# Install 'pid1' init daemon +# + +RUN wget -O- "https://github.com/fpco/pid1/releases/download/v$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 + +# +# Set up pid1 entrypoint and default command +# + +ENTRYPOINT ["/usr/local/sbin/pid1"] +CMD ["bash"] diff --git a/automated/dockerfiles/lts-9.0/Dockerfile b/automated/dockerfiles/lts-9.0/Dockerfile new file mode 100644 index 00000000..d5a479ae --- /dev/null +++ b/automated/dockerfiles/lts-9.0/Dockerfile @@ -0,0 +1,55 @@ +FROM ubuntu:16.04 + +MAINTAINER Emanuel Borsboom + +ARG GHC_VERSION=8.0.2 +ARG LTS_SLUG=lts-9.0 +ARG PID1_VERSION=0.1.0.1 +ARG BOOTSTRAP_COMMIT=1bc67bb54eda08c90d8421bc11d257354a379d11 +ARG DEBIAN_FRONTEND=noninteractive + +# +# Set encoding to UTF-8 and PATH to find GHC and cabal/stack-installed binaries. +# + +ENV LANG=C.UTF-8 \ + LC_ALL=C.UTF-8 \ + PATH=/root/.cabal/bin:/root/.local/bin:/opt/ghc/$GHC_VERSION/bin:$PATH + +# +# Use Stackage's debian-bootstrap.sh script to install system libraries and +# tools required to build any Stackage package. +# + +RUN apt-get update && \ + apt-get install -y wget && \ + wget -qO- https://raw.githubusercontent.com/fpco/stackage/$BOOTSTRAP_COMMIT/debian-bootstrap.sh | bash && \ + ln -s ghc /opt/ghc/$GHC_VERSION/share/doc/ghc-$GHC_VERSION && \ + rm -rf /var/lib/apt/lists/* + +# +# 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' +# files that some of these tools require. +# + +RUN stack --system-ghc --resolver=$LTS_SLUG --local-bin-path=/usr/local/bin install \ + cabal-install happy alex cpphs gtk2hs-buildtools hscolour && \ + cd $HOME/.stack && \ + find . -type f -not -path './snapshots/*/share/*' -exec rm '{}' \; && \ + find . -type d -print0 |sort -rz |xargs -0 rmdir 2>/dev/null || true + +# +# Install proper '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 + +# +# Set up pid1 entrypoint and default command +# + +ENTRYPOINT ["/usr/local/sbin/pid1"] +CMD ["bash"] diff --git a/automated/dockerfiles/lts-9.20/Dockerfile b/automated/dockerfiles/lts-9.20/Dockerfile new file mode 100644 index 00000000..b524e980 --- /dev/null +++ b/automated/dockerfiles/lts-9.20/Dockerfile @@ -0,0 +1,3 @@ +FROM fpco/stack-build:lts-9.0 +ARG STACK_VERSION=1.6.1 +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' diff --git a/automated/dockerfiles/lts-9.21/Dockerfile b/automated/dockerfiles/lts-9.21/Dockerfile new file mode 100644 index 00000000..4a875c91 --- /dev/null +++ b/automated/dockerfiles/lts-9.21/Dockerfile @@ -0,0 +1,3 @@ +FROM fpco/stack-build:lts-9.0 +ARG STACK_VERSION=1.6.5 +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'