Skip to content

Commit

Permalink
feat: adopt modern Dockerfile
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 df02b49 commit 7a08f48
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 10 deletions.
4 changes: 3 additions & 1 deletion apt-sync/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM ustcmirror/base:alpine
LABEL maintainer="iBug <[email protected]>"
LABEL bind_support=true
RUN apk add --no-cache --update wget perl ca-certificates git python3 py3-requests && \
RUN <<EOF
apk add --no-cache --update wget perl ca-certificates git python3 py3-requests
mkdir -p /usr/local/lib/tunasync
EOF
ADD tunasync /usr/local/lib/tunasync
ADD sync.sh sync.py /
7 changes: 4 additions & 3 deletions aptsync/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ LABEL bind_support=true
ENV APTSYNC_NTHREADS=20 \
APTSYNC_CREATE_DIR=true \
APTSYNC_UNLINK=0
RUN apk add --no-cache --update wget perl ca-certificates xz \
&& mkdir -p /var/spool/apt-mirror/mirror /var/spool/apt-mirror/skel /etc/apt/
RUN <<EOF
apk add --no-cache --update wget perl ca-certificates xz
mkdir -p /var/spool/apt-mirror/mirror /var/spool/apt-mirror/skel /etc/apt/
EOF
ADD ["apt-mirror", "/usr/local/bin/apt-mirror"]
RUN chmod +x /usr/local/bin/apt-mirror
ADD ["pre-sync.sh", "sync.sh", "/"]
Empty file modified aptsync/apt-mirror
100644 → 100755
Empty file.
4 changes: 3 additions & 1 deletion base/Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM alpine:3.20
LABEL maintainer="Jian Zeng <anonymousknight96 AT gmail.com>" \
org.ustcmirror.images=true
RUN apk add --no-cache bash tzdata su-exec && \
RUN <<EOF
apk add --no-cache bash tzdata su-exec
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
EOF
ADD ["entry.sh", "savelog", "/usr/local/bin/"]
ADD ["pip.conf", "/etc/"]
VOLUME ["/data", "/log"]
Expand Down
4 changes: 3 additions & 1 deletion base/Dockerfile.alpine-edge
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM alpine:edge
LABEL maintainer="Yifan Gao<git AT yfgao.com>" \
org.ustcmirror.images=true
RUN apk add --no-cache bash tzdata su-exec && \
RUN <<EOF
apk add --no-cache bash tzdata su-exec
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
EOF
ADD ["entry.sh", "savelog", "/usr/local/bin/"]
VOLUME ["/data", "/log"]
CMD ["entry.sh"]
12 changes: 8 additions & 4 deletions base/Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
FROM debian:bookworm-slim
LABEL maintainer="Jian Zeng <anonymousknight96 AT gmail.com>" \
org.ustcmirror.images=true
RUN echo 'Asia/Shanghai' > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata && \
apt-get update && apt-get install -y wget && \
wget -O /usr/local/bin/su-exec https://ftp.lug.ustc.edu.cn/misc/su-exec && chmod +x /usr/local/bin/su-exec && \
echo "592f25c51d0e4c90945ece8c4fa35018d20a1091ac109c98b66eb95deef211c7 /usr/local/bin/su-exec" | sha256sum -c - && \
RUN <<EOF
echo 'Asia/Shanghai' > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
apt-get update && apt-get install -y wget
wget -O /usr/local/bin/su-exec https://ftp.lug.ustc.edu.cn/misc/su-exec
chmod +x /usr/local/bin/su-exec
echo "592f25c51d0e4c90945ece8c4fa35018d20a1091ac109c98b66eb95deef211c7 /usr/local/bin/su-exec" | sha256sum -c -
apt-get purge -y --auto-remove wget && rm -rf /var/lib/apt/lists/*
EOF
ADD ["entry.sh", "savelog", "/usr/local/bin/"]
VOLUME ["/data", "/log"]
CMD ["entry.sh"]

0 comments on commit 7a08f48

Please sign in to comment.