Skip to content

Commit

Permalink
Upgrade to Debian 12 (#106)
Browse files Browse the repository at this point in the history
* Upgrade to Debian 12

- yum-sync: backports is no longer needed
- stackage: reorganize to fully utilize Debian built Haskell packages
- ghcup: use Debian built Haskell packages
  • Loading branch information
taoky authored Jan 3, 2024
1 parent 919bb06 commit 3d0ae98
Show file tree
Hide file tree
Showing 11 changed files with 246 additions and 571 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Notice: BIND_ADDRESS is only added for `curl` in freebsd-ports. Make sure that g
[![ghcup](https://img.shields.io/docker/image-size/ustcmirror/ghcup/latest)](https://hub.docker.com/r/ustcmirror/ghcup "ghcup")
[![ghcup](https://img.shields.io/docker/pulls/ustcmirror/ghcup)](https://hub.docker.com/r/ustcmirror/ghcup "ghcup")

ghcup does not have outstanding configuration options. See also [stackage](#stackage) on replacing the Hackage repository.
ghcup does not have outstanding configuration options.

### github-release

Expand Down Expand Up @@ -413,9 +413,7 @@ ref:
[![stackage](https://img.shields.io/docker/image-size/ustcmirror/stackage/latest)](https://hub.docker.com/r/ustcmirror/stackage "stackage")
[![stackage](https://img.shields.io/docker/pulls/ustcmirror/stackage)](https://hub.docker.com/r/ustcmirror/stackage "stackage")

Stackage doesn't need to specify upstream, but this mirror use cabal to install necessary Haskell packages. Replacing default mirror of cabal with faster one will speed up building process.

Read the [user guide](https://www.haskell.org/cabal/users-guide/installing-packages.html#repository-specification) before writing preferred mirror to `config`
Stackage doesn't need to specify upstream.

### tsumugu

Expand Down
2 changes: 1 addition & 1 deletion base/Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:bullseye-slim
FROM debian:bookworm-slim
LABEL maintainer="Jian Zeng <anonymousknight96 AT gmail.com>" \
org.ustcmirror.images=true
ADD ["entry.sh", "savelog", "/usr/local/bin/"]
Expand Down
2 changes: 1 addition & 1 deletion ghcup/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ustcmirror/base:debian
MAINTAINER Kai Ma <ksqsf@mail.ustc.edu.cn>
ADD ["config", "sync.sh", "prepare.sh", "ghcupsync.hs", "ghcupsync.cabal", "/"]
ADD ["sync.sh", "prepare.sh", "ghcupsync.hs", "/"]
RUN bash /prepare.sh && rm prepare.sh
117 changes: 0 additions & 117 deletions ghcup/config

This file was deleted.

21 changes: 9 additions & 12 deletions ghcup/prepare.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
#!/bin/bash
set -e

mkdir /root/.cabal
mv config /root/.cabal/
HASKELL_DEPS="ghc libghc-aeson-dev libghc-lens-dev libghc-lens-aeson-dev \
libghc-network-uri-dev libghc-split-dev libghc-typed-process-dev \
libghc-yaml-dev"
# Please use ldd to check the dependencies of compiled binary
HASKELL_KEEP="libyaml-0-2"

apt-get update
apt-get install -y aria2 ca-certificates git wget xz-utils apt-utils build-essential curl libffi-dev libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5 libnuma-dev
apt-get install -y aria2 ca-certificates git $HASKELL_DEPS $HASKELL_KEEP

curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 sh
source /root/.ghcup/env
ghcup install ghc 9.0.2
ghcup install cabal 3.6.2.0
ghcup set ghc 9.0.2
cabal update
cabal build -O2
cp $(cabal list-bin -O2 ghcupsync) /
# compile with Haskell language extensions
ghc -O2 -XScopedTypeVariables -XOverloadedStrings ghcupsync.hs

rm -rf /dist* /root/.cabal /root/.ghcup /root/.ghc && apt-get purge -y --auto-remove build-essential libffi-dev libgmp-dev libncurses-dev && rm -rf /var/lib/apt/lists/*
rm -rf /ghcupsync.* && apt-get purge -y --auto-remove $HASKELL_DEPS && rm -rf /var/lib/apt/lists/*
3 changes: 2 additions & 1 deletion stackage/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ustcmirror/base:debian
MAINTAINER Jiahao Li <gloit042@gmail.com>
ADD ["config", "sync.sh", "prepare.sh", "stackage.hs", "/"]
MAINTAINER Keyu Tao <taoky@ustclug.org>
ADD ["sync.sh", "prepare.sh", "stackage.hs", "/"]
RUN bash /prepare.sh && rm prepare.sh
1 change: 1 addition & 0 deletions stackage/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
本地调试可参考 stackage-stack 分支:<https://github.com/ustclug/ustcmirror-images/tree/stackage-stack/stackage>
Loading

0 comments on commit 3d0ae98

Please sign in to comment.