Skip to content

Commit

Permalink
refactor: prepare.sh is not needed anymore
Browse files Browse the repository at this point in the history
Signed-off-by: Jian Zeng <[email protected]>
  • Loading branch information
knight42 committed Aug 13, 2024
1 parent dd967b1 commit d45dfd8
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 44 deletions.
13 changes: 11 additions & 2 deletions debian-cd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ FROM ustcmirror/base:alpine
LABEL maintainer="Jian Zeng <anonymousknight96 AT gmail.com>"
LABEL bind_support=true
VOLUME ["/debian"]
ADD ["sync.sh", "pre-sync.sh", "prepare.sh", "/"]
ADD ["sync.sh", "pre-sync.sh", "/"]
ADD ["jigdo-mirror", "cd-mirror", "/usr/local/bin/"]
ADD jigdo-mirror.conf.in /etc/jigdo/
RUN /prepare.sh && rm /prepare.sh
RUN <<EOF
set -euo pipefail
apk add --no-cache wget ca-certificates rsync
mkdir -p /etc/jigdo
wget 'https://ftp.lug.ustc.edu.cn/misc/jigdo-bin-0.7.3.tar.bz2'
echo "58b8a6885822e55f365c99131c906f16ceaaf657c566e10f410d026704cad157 jigdo-bin-0.7.3.tar.bz2" | sha256sum -c -
tar xf jigdo-bin-0.7.3.tar.bz2 jigdo-bin-0.7.3/jigdo-file
mv jigdo-bin-0.7.3/jigdo-file /usr/local/bin/
rm -rf jigdo-bin-*
EOF
9 changes: 0 additions & 9 deletions debian-cd/prepare.sh

This file was deleted.

22 changes: 20 additions & 2 deletions ghcup/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
FROM ustcmirror/base:debian
LABEL maintainer="Kai Ma <[email protected]>"
ADD ["sync.sh", "prepare.sh", "ghcupsync.hs", "/"]
RUN bash /prepare.sh && rm prepare.sh
ADD ["sync.sh", "ghcupsync.hs", "/"]
RUN --mount=type=cache,sharing=locked,target=/var/cache/apt \
--mount=type=cache,sharing=locked,target=/var/lib/apt <<EOF
#!/bin/bash

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 curl $HASKELL_DEPS $HASKELL_KEEP

# compile with Haskell language extensions
ghc -O2 -XScopedTypeVariables -XOverloadedStrings ghcupsync.hs

rm -rf /ghcupsync.* && apt-get purge -y --auto-remove $HASKELL_DEPS

EOF
16 changes: 0 additions & 16 deletions ghcup/prepare.sh

This file was deleted.

19 changes: 17 additions & 2 deletions stackage/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
FROM ustcmirror/base:debian
LABEL maintainer="Jiahao Li <[email protected]>"
LABEL maintainer="Keyu Tao <[email protected]>"
ADD ["sync.sh", "prepare.sh", "stackage.hs", "/"]
RUN bash /prepare.sh && rm prepare.sh
ADD ["sync.sh", "stackage.hs", "/"]
RUN --mount=type=cache,sharing=locked,target=/var/cache/apt \
--mount=type=cache,sharing=locked,target=/var/lib/apt <<EOF
#!/bin/bash

HASKELL_DEPS="ghc libghc-yaml-dev libghc-process-extras-dev \
libghc-aeson-dev libghc-split-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 $HASKELL_DEPS $HASKELL_KEEP
ghc -O2 stackage.hs

rm -rf stackage.* && apt-get purge --auto-remove -y $HASKELL_DEPS

EOF
13 changes: 0 additions & 13 deletions stackage/prepare.sh

This file was deleted.

0 comments on commit d45dfd8

Please sign in to comment.