Skip to content

Commit

Permalink
Updated support mirrors.hust.edu.cn source
Browse files Browse the repository at this point in the history
  • Loading branch information
wumingzhilian committed May 16, 2024
1 parent 3b9f18c commit 1e372c7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ FROM ubuntu:22.04
ENV DEBIAN_FRONTEND noninteractive
ENV LC_CTYPE=C.UTF-8

RUN apt-get update && \
RUN sed -i.bak 's|https\?://archive.ubuntu.com|https://mirrors.hust.edu.cn|g' /etc/apt/sources.list \
apt-get update && \
apt-get install -y \
build-essential \
git \
Expand Down
6 changes: 6 additions & 0 deletions challenge/Dockerfile_amd64
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ EOF

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sed -i.bak 's|https\?://archive.ubuntu.com|https://mirrors.hust.edu.cn|g' /etc/apt/sources.list \
apt-get update && xargs apt-get install --no-install-recommends -yqq <<EOF && \
apt-get clean && rm -rf /var/lib/apt/lists/*
ca-certificates
Expand All @@ -64,6 +65,7 @@ FROM essentials as builder-essentials

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sed -i.bak 's|https\?://archive.ubuntu.com|https://mirrors.hust.edu.cn|g' /etc/apt/sources.list \
apt-get update && xargs apt-get install --no-install-recommends -yqq <<EOF && \
apt-get clean && rm -rf /var/lib/apt/lists/*
build-essential
Expand All @@ -75,6 +77,7 @@ FROM builder-essentials as builder

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sed -i.bak 's|https\?://archive.ubuntu.com|https://mirrors.hust.edu.cn|g' /etc/apt/sources.list \
apt-get update && xargs apt-get install --no-install-recommends -yqq <<EOF && \
apt-get clean && rm -rf /var/lib/apt/lists/*
autoconf
Expand Down Expand Up @@ -356,6 +359,7 @@ ARG UBUNTU_VERSION=20.04
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
[ "${UBUNTU_VERSION}" == "20.04" ] && TGR=common || TGR=tools; \
sed -i.bak 's|https\?://archive.ubuntu.com|https://mirrors.hust.edu.cn|g' /etc/apt/sources.list \
apt-get update && xargs apt-get install --no-install-recommends -yqq <<EOF && \
apt-get clean && rm -rf /var/lib/apt/lists/*
novnc
Expand All @@ -376,6 +380,7 @@ FROM builder-desktop-base-yes as builder-desktop-xfce-yes

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sed -i.bak 's|https\?://archive.ubuntu.com|https://mirrors.hust.edu.cn|g' /etc/apt/sources.list \
apt-get update && xargs apt-get install -yqq <<EOF && \
apt-get -y remove --purge at-spi2-core tumbler gvfs-* && \
apt-get -y autoremove && \
Expand Down Expand Up @@ -462,6 +467,7 @@ FROM essentials as builder-tools-apt-yes

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sed -i.bak 's|https\?://archive.ubuntu.com|https://mirrors.hust.edu.cn|g' /etc/apt/sources.list \
apt-get update && xargs apt-get install --no-install-recommends -yqq <<EOF && \
apt-get clean && rm -rf /var/lib/apt/lists/*
arping
Expand Down
6 changes: 6 additions & 0 deletions challenge/Dockerfile_arm64
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ EOF

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sed -i.bak 's|https\?://archive.ubuntu.com|https://mirrors.hust.edu.cn|g' /etc/apt/sources.list \
apt-get update && xargs apt-get install --no-install-recommends -yqq <<EOF && \
apt-get clean && rm -rf /var/lib/apt/lists/*
ca-certificates
Expand All @@ -62,6 +63,7 @@ FROM essentials as builder-essentials

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sed -i.bak 's|https\?://archive.ubuntu.com|https://mirrors.hust.edu.cn|g' /etc/apt/sources.list \
apt-get update && xargs apt-get install --no-install-recommends -yqq <<EOF && \
apt-get clean && rm -rf /var/lib/apt/lists/*
build-essential
Expand All @@ -73,6 +75,7 @@ FROM builder-essentials as builder

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sed -i.bak 's|https\?://archive.ubuntu.com|https://mirrors.hust.edu.cn|g' /etc/apt/sources.list \
apt-get update && xargs apt-get install --no-install-recommends -yqq <<EOF && \
apt-get clean && rm -rf /var/lib/apt/lists/*
autoconf
Expand Down Expand Up @@ -342,6 +345,7 @@ ARG UBUNTU_VERSION=20.04
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
[ "${UBUNTU_VERSION}" == "20.04" ] && TGR=common || TGR=tools; \
sed -i.bak 's|https\?://archive.ubuntu.com|https://mirrors.hust.edu.cn|g' /etc/apt/sources.list \
apt-get update && xargs apt-get install --no-install-recommends -yqq <<EOF && \
apt-get clean && rm -rf /var/lib/apt/lists/*
novnc
Expand All @@ -362,6 +366,7 @@ FROM builder-desktop-base-yes as builder-desktop-xfce-yes

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sed -i.bak 's|https\?://archive.ubuntu.com|https://mirrors.hust.edu.cn|g' /etc/apt/sources.list \
apt-get update && xargs apt-get install -yqq <<EOF && \
apt-get -y remove --purge at-spi2-core tumbler gvfs-* && \
apt-get -y autoremove && \
Expand Down Expand Up @@ -409,6 +414,7 @@ FROM essentials as builder-tools-apt-yes

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sed -i.bak 's|https\?://archive.ubuntu.com|https://mirrors.hust.edu.cn|g' /etc/apt/sources.list \
apt-get update && xargs apt-get install --no-install-recommends -yqq <<EOF && \
apt-get clean && rm -rf /var/lib/apt/lists/*
arping
Expand Down
6 changes: 4 additions & 2 deletions ctfd/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM python:3.9-slim-buster as build
WORKDIR /opt/CTFd

RUN apt-get update \
RUN sed -i.bak 's|https\?://archive.ubuntu.com|https://mirrors.hust.edu.cn|g' /etc/apt/sources.list \
apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
libffi-dev \
Expand All @@ -24,7 +25,8 @@ COPY . /opt/CTFd
FROM python:3.9-slim-buster as release
WORKDIR /opt/CTFd

RUN apt-get update \
RUN sed -i.bak 's|https\?://archive.ubuntu.com|https://mirrors.hust.edu.cn|g' /etc/apt/sources.list \
apt-get update \
&& apt-get install -y --no-install-recommends \
libffi6 \
libssl1.1 \
Expand Down

0 comments on commit 1e372c7

Please sign in to comment.