summaryrefslogtreecommitdiff
path: root/docker_builds/docker_ghcup
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2021-01-21 20:59:10 +0100
committerMiguel <m.i@gmx.at>2021-01-21 20:59:10 +0100
commit5ec428a0c177025b9c04330ae3f39cbde27a2d81 (patch)
tree40b5bfbcd1705e312b240c2c5c144f5a79889504 /docker_builds/docker_ghcup
parent3ccd1cf7427768cb390527a45753e0cc32f4d609 (diff)
add dokcer builds
Diffstat (limited to 'docker_builds/docker_ghcup')
-rw-r--r--docker_builds/docker_ghcup/Dockerfile57
-rw-r--r--docker_builds/docker_ghcup/README.md28
2 files changed, 85 insertions, 0 deletions
diff --git a/docker_builds/docker_ghcup/Dockerfile b/docker_builds/docker_ghcup/Dockerfile
new file mode 100644
index 0000000..4ac21f8
--- /dev/null
+++ b/docker_builds/docker_ghcup/Dockerfile
@@ -0,0 +1,57 @@
+FROM debian:buster
+
+ARG GHC_VERSION=
+ARG USER=haskeller
+ENV PATH="/home/${USER}/.cabal/bin:/home/${USER}/.ghcup/bin:${PATH}"
+
+RUN echo "Dear Sir or Madam," && \
+ echo "" && \
+ echo "Welcome to Miguel's Docker Builder." && \
+ echo "We are building a fresh Haskell Environment." && \
+ echo "" && \
+ echo "This Build is parametrized as follows:" && \
+ echo "" && \
+ echo "GHC_VERSION = ${GHC_VERSION}" && \
+ echo "PATH = ${PATH}" && \
+ echo "USER = ${USER}" && \
+ echo "" && \
+ echo "[STEP 1 : INSTALLING DEPS VIA APT]" && \
+ echo "" && \
+ apt-get update && \
+ apt-get install -y \
+ curl \
+ xz-utils \
+ gcc \
+ make \
+ libtinfo5 \
+ libgmp-dev \
+ zlib1g-dev && \
+ echo "" && \
+ echo "[STEP 2 : CREATE USER & HOMEDIR]" && \
+ echo "" && \
+ useradd -ms /bin/bash ${USER} && \
+ echo "" && \
+ echo "[STEP 3 : DOWNLOAD AND INSTALL ghcup]" && \
+ echo "" && \
+ su ${USER} -c "mkdir -p ~/.ghcup/bin" && \
+ su ${USER} -c "curl https://gitlab.haskell.org/haskell/ghcup/raw/master/ghcup > ~/.ghcup/bin/ghcup" && \
+ su ${USER} -c "chmod +x ~/.ghcup/bin/ghcup" && \
+ echo "" && \
+ echo "[STEP 4 : INSTALL ghc VIA ghcup]" && \
+ echo "" && \
+ su ${USER} -c "ghcup install ${GHC_VERSION}" && \
+ su ${USER} -c "ghcup set ${GHC_VERSION}" && \
+ echo "" && \
+ echo "[STEP 5 : INSTALL & UPDATE cabal]" && \
+ echo "" && \
+ su ${USER} -c "ghcup install-cabal" && \
+ su ${USER} -c "cabal update" && \
+ su ${USER} -c "cabal new-install cabal-install" && \
+ echo "" && \
+ echo "[FINISHED! THANK YOU FOR YOUR PATIENCE]" && \
+ echo ""
+
+USER ${USER}
+ENV PATH="/home/${USER}/.cabal/bin:/home/${USER}/.ghcup/bin:${PATH}"
+RUN cabal install ghcid
+RUN cabal install hlint
diff --git a/docker_builds/docker_ghcup/README.md b/docker_builds/docker_ghcup/README.md
new file mode 100644
index 0000000..74acc0c
--- /dev/null
+++ b/docker_builds/docker_ghcup/README.md
@@ -0,0 +1,28 @@
+# GHC and Cabal via ghcup
+
+Fresh Haskell developer environment bootstrapped from scratch via ghcup.
+
+This image is based on debian:buster
+
+Happy Haskelling!
+
+## Building
+
+By default the best known GHC version is used but you can override it:
+
+ sudo docker build --tag miguel/ghcup:8.6.5 --build-arg GHC_VERSION=8.6.5 .
+ sudo docker build --tag miguel/ghcup:8.6 --build-arg GHC_VERSION=8.6 .
+
+the default user is `haskeller` but you can override it via the USER build argument
+
+## Using
+
+You can use this image as a base for your projects or standalone:
+
+ sudo docker run -it --entrypoint bash miguel/ghcup:8.6
+
+## Prebuilt Images and Sources
+
+Some prebuild images might be found on: https://cloud.docker.com/repository/docker/migueldirty/ghcup
+
+Dockerfile is hosted here: https://github.com/miguelclean/docker_ghcup