Skip to content

Commit

Permalink
Merge pull request #2128 from IntersectMBO/develop
Browse files Browse the repository at this point in the history
Switch base image from Debian Buster to Ubuntu 24.04 to resolve PostgreSQL repository issue
  • Loading branch information
MSzalowski authored Oct 7, 2024
2 parents 45a52d1 + f9fdbd0 commit 2469720
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 6 deletions.
52 changes: 48 additions & 4 deletions govtool/backend/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,60 @@
# process by ensuring it only needs to compile against these dependencies. This
# is a common practice in Haskell projects, as it can significantly reduce the
# time it takes to build the project.
#
# The reason why we do not use the official haskell image is that the official
# image does not include the necessary dependencies for the project, which are
# unobtainable from the official image.

FROM haskell:9.2.7-buster
FROM ubuntu:24.04

# Set the working directory
WORKDIR /src

# Set noninteractive mode
ENV DEBIAN_FRONTEND=noninteractive

# Update package list and install dependencies
RUN apt-get update && \
apt-get install -y wget lsb-release && \
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \
apt-get install -y \
software-properties-common \
wget \
gnupg \
curl \
build-essential \
libncurses-dev \
libgmp-dev \
liblzma-dev \
pkg-config \
zlib1g-dev \
xz-utils

# Install PostgreSQL 14
RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
apt-get update && \
apt-get install -y postgresql-14 libpq-dev

# Download and install GHC 9.2.7
RUN wget https://downloads.haskell.org/~ghc/9.2.7/ghc-9.2.7-x86_64-deb10-linux.tar.xz && \
tar -xf ghc-9.2.7-x86_64-deb10-linux.tar.xz && \
cd ghc-9.2.7 && \
./configure && \
make install && \
cd .. && \
rm -rf ghc-9.2.7 ghc-9.2.7-x86_64-deb10-linux.tar.xz

# Install Cabal
RUN wget https://downloads.haskell.org/~cabal/cabal-install-3.6.2.0/cabal-install-3.6.2.0-x86_64-linux-deb10.tar.xz && \
tar -xf cabal-install-3.6.2.0-x86_64-linux-deb10.tar.xz && \
mv cabal /usr/local/bin/ && \
rm cabal-install-3.6.2.0-x86_64-linux-deb10.tar.xz

# Copy the project files into the container
COPY . .
RUN cabal update && cabal configure && cabal install --only-dependencies && rm -rf /src/*

# Install the project dependencies
RUN cabal update && \
cabal configure && \
cabal install --only-dependencies && \
rm -rf /src/*
2 changes: 1 addition & 1 deletion scripts/govtool/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include config.mk
.DEFAULT_GOAL := info

# image tags
cardano_node_image_tag := 9.1.1
cardano_node_image_tag := 9.2.1
cardano_db_sync_image_tag := 13.5.0.2

.PHONY: all
Expand Down
2 changes: 1 addition & 1 deletion scripts/govtool/docker-compose.node+dbsync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ services:
retries: 5

cardano-node:
image: ghcr.io/intersectmbo/cardano-node:9.1.1
image: ghcr.io/intersectmbo/cardano-node:9.2.1
environment:
- NETWORK=sanchonet
volumes:
Expand Down

0 comments on commit 2469720

Please sign in to comment.