Skip to content

Commit 906ad59

Browse files
authored
Merge pull request #1 from acilearning/2022-08-04-stackless
Reduce image size
2 parents 1dc11f1 + fb97119 commit 906ad59

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

.github/workflows/workflow.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ name: Workflow
22
on: push
33
jobs:
44
docker:
5-
name: Docker
5+
strategy:
6+
matrix:
7+
ghc:
8+
- 9.0.2
9+
name: Docker with GHC ${{ matrix.ghc }}
610
runs-on: ubuntu-latest
711
steps:
812
- uses: actions/checkout@v3
@@ -13,14 +17,19 @@ jobs:
1317
with:
1418
images: ghcr.io/${{ github.repository }}
1519
flavor: latest=false
16-
tags: type=sha,format=long
20+
tags: |
21+
type=sha,format=long,prefix=${{ matrix.ghc }}-
22+
type=raw,value=${{ matrix.ghc }},enable={{ is_default_branch }}
1723
- uses: docker/login-action@v2
1824
with:
1925
password: ${{ secrets.GITHUB_TOKEN }}
2026
registry: ghcr.io
2127
username: ${{ github.actor }}
2228
- uses: docker/build-push-action@v3
2329
with:
30+
build-args: GHC_VERSION=${{ matrix.ghc }}
31+
cache-from: type=gha
32+
cache-to: type=gha,mode=max
2433
labels: ${{ steps.meta.outputs.labels }}
2534
platforms: linux/amd64,linux/arm64
2635
push: true

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ ARG GHC_VERSION=9.0.2
5656
RUN \
5757
set -o errexit -o xtrace; \
5858
ghcup install ghc "$GHC_VERSION" --set; \
59+
ghcup gc --profiling-libs --share-dir; \
5960
ghc --version
6061

6162
# Install Cabal.
@@ -80,6 +81,7 @@ ARG HLS_VERSION=1.7.0.0
8081
RUN \
8182
set -o errexit -o xtrace; \
8283
ghcup install hls "$HLS_VERSION" --set; \
84+
ghcup gc --hls-no-ghc; \
8385
haskell-language-server-wrapper --version
8486

8587
# Configure Cabal.

README.markdown

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# docker-haskell
2+
3+
This Docker image provides a Haskell development environment with the following tools:
4+
5+
- [GHCup](https://www.haskell.org/ghcup/)
6+
- [GHC](https://www.haskell.org/ghc/)
7+
- [Cabal](https://www.haskell.org/cabal/)
8+
- [Stack](https://docs.haskellstack.org/en/stable/README/)
9+
- [HLS](https://haskell-language-server.readthedocs.io/en/latest/)

0 commit comments

Comments
 (0)