Skip to content

Commit a1d175d

Browse files
authored
[NO-ISSUE] Have explicit version ARGS in docker for tools (#557)
1 parent 8558d32 commit a1d175d

File tree

5 files changed

+27
-18
lines changed

5 files changed

+27
-18
lines changed

.github/workflows/docker-image.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
registry: ghcr.io
2020
username: ${{ github.actor }}
2121
password: ${{ secrets.GITHUB_TOKEN }}
22-
- name: Build the hello-docker Docker image
22+
- name: Build the Docker image
2323
run: |
2424
docker build . --tag ghcr.io/flora-pm/flora-server:latest
2525
docker run ghcr.io/flora-pm/flora-server:latest

.github/workflows/test-docker-image.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
16-
- name: Build the hello-docker Docker image
16+
- name: Build the Docker image
1717
run: make docker-build

Dockerfile

+23-15
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@ FROM ubuntu@sha256:67211c14fa74f070d27cc59d69a7fa9aeff8e28ea118ef3babc295a0428a6
55
ARG GID=1000
66
ARG UID=1000
77

8-
ARG ghc_version=9.6.5
9-
ARG cabal_version=3.10.3.0
8+
ARG GHC_VERSION=9.6.5
9+
ARG CABAL_VERSION=3.10.3.0
10+
ARG FOURMOLU_VERSION=0.14.1.0
11+
ARG HLINT_VERSION=3.8
12+
ARG APPLY_REFACT_VERSION=0.14.0.0
13+
ARG CABAL_FMT_VERSION=0.1.12
14+
ARG GHCID_VERSION=0.8.9
15+
ARG GHC_TAGS_VERSION=1.8
16+
ARG POSTGRESQL_MIGRATION_VERSION=0.2.1.8
1017

1118
# generate a working directory
1219
USER "root"
@@ -23,29 +30,29 @@ RUN chown -R $USER:$USER /home/$USER/.cabal
2330
WORKDIR /flora-server
2431

2532
RUN apt update && \
26-
apt install -y build-essential curl libffi-dev libffi8 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5 git libsodium-dev
33+
apt install -y build-essential curl libffi-dev libffi8 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5 git libsodium-dev pkg-config
2734

2835
# install dependencies (pg_config, postgresql-client, yarn)
2936
ENV BOOTSTRAP_HASKELL_NONINTERACTIVE="YES"
30-
ENV BOOTSTRAP_HASKELL_GHC_VERSION="$ghc_version"
31-
ENV BOOTSTRAP_HASKELL_CABAL_VERSION="$cabal_version"
3237
ENV BOOTSTRAP_HASKELL_INSTALL_NO_STACK="YES"
3338
ENV BOOTSTRAP_HASKELL_INSTALL_NO_STACK_HOOK="YES"
34-
ENV BOOTSTRAP_HASKELL_INSTALL_HLS="YES"
39+
ENV PATH="$PATH:/home/$USER/.ghcup/bin"
3540
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
3641
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
3742
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
3843
RUN apt install -y nodejs libpq-dev mcpp wget zsh tmux postgresql-client
3944
RUN corepack enable
40-
RUN chmod ugo+x /home/$USER/.cabal
41-
4245
USER ${USER}
46+
RUN chmod ugo+x /home/$USER/.cabal
4347
RUN git config --global --add safe.directory "*"
4448
RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
4549

50+
RUN ghcup install hls $HLS_VERSION \
51+
&& ghcup install ghc $GHC_VERSION \
52+
&& ghcup set ghc $GHC_VERSION \
53+
&& ghcup install cabal $CABAL_VERSION
4654

4755
USER ${USER}
48-
ENV PATH="$PATH:/home/$USER/.ghcup/bin"
4956

5057
# install soufflé
5158
USER "root"
@@ -59,12 +66,13 @@ RUN echo $PATH
5966
# to run `cabal update` as separate step, as cabal doesn't delete
6067
# package versions)
6168
RUN cabal update
62-
RUN cabal install -j postgresql-migration
63-
RUN cabal install -j hlint apply-refact
64-
RUN cabal install -j fourmolu-0.14.1.0
65-
RUN cabal install -j cabal-fmt
66-
RUN cabal install -j ghcid
67-
RUN cabal install -j ghc-tags
69+
RUN cabal install -j postgresql-migration-$POSTGRESQL_MIGRATION_VERSION
70+
RUN cabal install -j hlint-$HLINT_VERSION
71+
RUN cabal install -j apply-refact-$APPLY_REFACT_VERSION
72+
RUN cabal install -j fourmolu-$FOURMOLU_VERSION
73+
RUN cabal install -j cabal-fmt-$CABAL_FMT_VERSION
74+
RUN cabal install -j ghcid-$GHCID_VERSION
75+
RUN cabal install -j ghc-tags-$GHC_TAGS_VERSION
6876

6977
# configure the shell
7078
RUN sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

changelog.d/557

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
synopsis: Have explicit version ARGS in docker for tools
2+
prs: #557

docker-compose.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: "3"
21
services:
32
server:
43
image: ghcr.io/flora-pm/flora-server:latest

0 commit comments

Comments
 (0)