Skip to content
Snippets Groups Projects
Verified Commit 47bc5a55 authored by Olivier Benz's avatar Olivier Benz
Browse files

Update Dockerfiles for GHC versions 9.8.1, 9.6.4 and 9.4.8

- Reduce images size by about 200 MB
- Close https://github.com/benz0li/ghc-musl/issues/6
parent daa513df
No related branches found
No related tags found
No related merge requests found
Pipeline #25874 passed
...@@ -67,7 +67,7 @@ RUN cabal update \ ...@@ -67,7 +67,7 @@ RUN cabal update \
## See https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history ## See https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history
&& cabal install "cabal-install-$CABAL_VERSION" && cabal install "cabal-install-$CABAL_VERSION"
FROM alpine:3.19 as ghc-stage1 FROM alpine:3.19 as ghc-base
LABEL org.opencontainers.image.licenses="MIT" \ LABEL org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.source="https://gitlab.b-data.ch/ghc/ghc-musl" \ org.opencontainers.image.source="https://gitlab.b-data.ch/ghc/ghc-musl" \
...@@ -116,6 +116,8 @@ RUN apk add --no-cache \ ...@@ -116,6 +116,8 @@ RUN apk add --no-cache \
zlib-dev \ zlib-dev \
zlib-static zlib-static
FROM ghc-base as ghc-stage1
COPY --from=bootstrap-ghc /tmp/ghc-"$GHC_VERSION"/_build/bindist/ghc-"$GHC_VERSION"-*-alpine-linux.tar.xz /tmp/ COPY --from=bootstrap-ghc /tmp/ghc-"$GHC_VERSION"/_build/bindist/ghc-"$GHC_VERSION"-*-alpine-linux.tar.xz /tmp/
RUN cd /tmp \ RUN cd /tmp \
...@@ -162,7 +164,10 @@ RUN ghc -static -optl-pthread -optl-static Main.hs \ ...@@ -162,7 +164,10 @@ RUN ghc -static -optl-pthread -optl-static Main.hs \
&& cabal init -n --is-executable -p tester -l MIT \ && cabal init -n --is-executable -p tester -l MIT \
&& cabal run && cabal run
FROM ghc-stage1 FROM ghc-base
## Install GHC and Stack
COPY --from=ghc-stage1 /usr/local /usr/local
## Install Cabal (the tool) built with the GHC target version ## Install Cabal (the tool) built with the GHC target version
COPY --from=ghc-stage2 /root/.local/bin/cabal /usr/local/bin/cabal COPY --from=ghc-stage2 /root/.local/bin/cabal /usr/local/bin/cabal
......
...@@ -67,7 +67,7 @@ RUN cabal update \ ...@@ -67,7 +67,7 @@ RUN cabal update \
## See https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history ## See https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history
&& cabal install "cabal-install-$CABAL_VERSION" && cabal install "cabal-install-$CABAL_VERSION"
FROM alpine:3.19 as ghc-stage1 FROM alpine:3.19 as ghc-base
LABEL org.opencontainers.image.licenses="MIT" \ LABEL org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.source="https://gitlab.b-data.ch/ghc/ghc-musl" \ org.opencontainers.image.source="https://gitlab.b-data.ch/ghc/ghc-musl" \
...@@ -116,6 +116,8 @@ RUN apk add --no-cache \ ...@@ -116,6 +116,8 @@ RUN apk add --no-cache \
zlib-dev \ zlib-dev \
zlib-static zlib-static
FROM ghc-base as ghc-stage1
COPY --from=bootstrap-ghc /tmp/ghc-"$GHC_VERSION"/_build/bindist/ghc-"$GHC_VERSION"-*-alpine-linux.tar.xz /tmp/ COPY --from=bootstrap-ghc /tmp/ghc-"$GHC_VERSION"/_build/bindist/ghc-"$GHC_VERSION"-*-alpine-linux.tar.xz /tmp/
RUN cd /tmp \ RUN cd /tmp \
...@@ -162,7 +164,10 @@ RUN ghc -static -optl-pthread -optl-static Main.hs \ ...@@ -162,7 +164,10 @@ RUN ghc -static -optl-pthread -optl-static Main.hs \
&& cabal init -n --is-executable -p tester -l MIT \ && cabal init -n --is-executable -p tester -l MIT \
&& cabal run && cabal run
FROM ghc-stage1 FROM ghc-base
## Install GHC and Stack
COPY --from=ghc-stage1 /usr/local /usr/local
## Install Cabal (the tool) built with the GHC target version ## Install Cabal (the tool) built with the GHC target version
COPY --from=ghc-stage2 /root/.cabal/bin/cabal /usr/local/bin/cabal COPY --from=ghc-stage2 /root/.cabal/bin/cabal /usr/local/bin/cabal
......
...@@ -67,7 +67,7 @@ RUN cabal update \ ...@@ -67,7 +67,7 @@ RUN cabal update \
## See https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history ## See https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history
&& cabal install "cabal-install-$CABAL_VERSION" && cabal install "cabal-install-$CABAL_VERSION"
FROM alpine:3.19 as ghc-stage1 FROM alpine:3.19 as ghc-base
LABEL org.opencontainers.image.licenses="MIT" \ LABEL org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.source="https://gitlab.b-data.ch/ghc/ghc-musl" \ org.opencontainers.image.source="https://gitlab.b-data.ch/ghc/ghc-musl" \
...@@ -116,6 +116,8 @@ RUN apk add --no-cache \ ...@@ -116,6 +116,8 @@ RUN apk add --no-cache \
zlib-dev \ zlib-dev \
zlib-static zlib-static
FROM ghc-base as ghc-stage1
COPY --from=bootstrap-ghc /tmp/ghc-"$GHC_VERSION"/_build/bindist/ghc-"$GHC_VERSION"-*-alpine-linux.tar.xz /tmp/ COPY --from=bootstrap-ghc /tmp/ghc-"$GHC_VERSION"/_build/bindist/ghc-"$GHC_VERSION"-*-alpine-linux.tar.xz /tmp/
RUN cd /tmp \ RUN cd /tmp \
...@@ -162,7 +164,10 @@ RUN ghc -static -optl-pthread -optl-static Main.hs \ ...@@ -162,7 +164,10 @@ RUN ghc -static -optl-pthread -optl-static Main.hs \
&& cabal init -n --is-executable -p tester -l MIT \ && cabal init -n --is-executable -p tester -l MIT \
&& cabal run && cabal run
FROM ghc-stage1 FROM ghc-base
## Install GHC and Stack
COPY --from=ghc-stage1 /usr/local /usr/local
## Install Cabal (the tool) built with the GHC target version ## Install Cabal (the tool) built with the GHC target version
COPY --from=ghc-stage2 /root/.local/bin/cabal /usr/local/bin/cabal COPY --from=ghc-stage2 /root/.local/bin/cabal /usr/local/bin/cabal
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment