|
@@ -56,6 +56,10 @@ ENV DEBIAN_FRONTEND=noninteractive \
|
|
|
RUN <<EOF
|
|
RUN <<EOF
|
|
|
# Tools
|
|
# Tools
|
|
|
|
|
|
|
|
|
|
+ # Use Tsinghua mirrors for Ubuntu
|
|
|
|
|
+ sed -i 's|//archive.ubuntu.com|//mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list
|
|
|
|
|
+ sed -i 's|//security.ubuntu.com|//mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list
|
|
|
|
|
+
|
|
|
# Refresh
|
|
# Refresh
|
|
|
apt-get update -y && apt-get install -y --no-install-recommends \
|
|
apt-get update -y && apt-get install -y --no-install-recommends \
|
|
|
software-properties-common apt-transport-https \
|
|
software-properties-common apt-transport-https \
|
|
@@ -134,7 +138,7 @@ RUN <<EOF
|
|
|
# Install
|
|
# Install
|
|
|
apt-get install -y --no-install-recommends \
|
|
apt-get install -y --no-install-recommends \
|
|
|
make ninja-build pkg-config ccache
|
|
make ninja-build pkg-config ccache
|
|
|
- curl --retry 3 --retry-connrefused -fL "https://github.com/Kitware/CMake/releases/download/v3.31.7/cmake-3.31.7-linux-$(uname -m).tar.gz" | tar -zx -C /usr --strip-components 1
|
|
|
|
|
|
|
+ curl --retry 3 --retry-connrefused -fL "https://gh-proxy.com/https://github.com/Kitware/CMake/releases/download/v3.31.7/cmake-3.31.7-linux-$(uname -m).tar.gz" | tar -zx -C /usr --strip-components 1
|
|
|
|
|
|
|
|
# Install dependencies
|
|
# Install dependencies
|
|
|
apt-get install -y --no-install-recommends \
|
|
apt-get install -y --no-install-recommends \
|
|
@@ -174,10 +178,12 @@ RUN <<EOF
|
|
|
exit 0
|
|
exit 0
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
- # Add deadsnakes PPA for Python versions
|
|
|
|
|
|
|
+ # Add deadsnakes PPA for Python versions (use Tsinghua mirror)
|
|
|
for i in 1 2 3; do
|
|
for i in 1 2 3; do
|
|
|
- add-apt-repository -y ppa:deadsnakes/ppa && break || { echo "Attempt $i failed, retrying in 5s..."; sleep 5; }
|
|
|
|
|
|
|
+ add-apt-repository -y ppa:deadsnakes/ppa --yes && break || { echo "Attempt $i failed, retrying in 5s..."; sleep 5; }
|
|
|
done
|
|
done
|
|
|
|
|
+ # Replace PPA with Tsinghua mirror
|
|
|
|
|
+ sed -i 's|ppa.launchpadcontent.net|launchpad.proxy.ustclug.org|g' /etc/apt/sources.list.d/*.list
|
|
|
apt-get update -y
|
|
apt-get update -y
|
|
|
|
|
|
|
|
# Install
|
|
# Install
|
|
@@ -196,7 +202,7 @@ RUN <<EOF
|
|
|
# Update alternatives
|
|
# Update alternatives
|
|
|
if [[ -f /etc/alternatives/python3 ]]; then update-alternatives --remove-all python3; fi; update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1
|
|
if [[ -f /etc/alternatives/python3 ]]; then update-alternatives --remove-all python3; fi; update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1
|
|
|
if [[ -f /etc/alternatives/python ]]; then update-alternatives --remove-all python; fi; update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1
|
|
if [[ -f /etc/alternatives/python ]]; then update-alternatives --remove-all python; fi; update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1
|
|
|
- curl -sS "https://bootstrap.pypa.io/get-pip.py" | python${PYTHON_VERSION}
|
|
|
|
|
|
|
+ curl -sS "https://gh-proxy.com/https://raw.githubusercontent.com/pypa/get-pip/main/get-pip.py" | python${PYTHON_VERSION}
|
|
|
if [[ -f /etc/alternatives/2to3 ]]; then update-alternatives --remove-all 2to3; fi; update-alternatives --install /usr/bin/2to3 2to3 /usr/bin/2to3${PYTHON_VERSION} 1 || true
|
|
if [[ -f /etc/alternatives/2to3 ]]; then update-alternatives --remove-all 2to3; fi; update-alternatives --install /usr/bin/2to3 2to3 /usr/bin/2to3${PYTHON_VERSION} 1 || true
|
|
|
if [[ -f /etc/alternatives/pydoc3 ]]; then update-alternatives --remove-all pydoc3; fi; update-alternatives --install /usr/bin/pydoc3 pydoc3 /usr/bin/pydoc${PYTHON_VERSION} 1 || true
|
|
if [[ -f /etc/alternatives/pydoc3 ]]; then update-alternatives --remove-all pydoc3; fi; update-alternatives --install /usr/bin/pydoc3 pydoc3 /usr/bin/pydoc${PYTHON_VERSION} 1 || true
|
|
|
if [[ -f /etc/alternatives/idle3 ]]; then update-alternatives --remove-all idle3; fi; update-alternatives --install /usr/bin/idle3 idle3 /usr/bin/idle${PYTHON_VERSION} 1 || true
|
|
if [[ -f /etc/alternatives/idle3 ]]; then update-alternatives --remove-all idle3; fi; update-alternatives --install /usr/bin/idle3 idle3 /usr/bin/idle${PYTHON_VERSION} 1 || true
|
|
@@ -241,7 +247,7 @@ hatchling
|
|
|
py-spy
|
|
py-spy
|
|
|
poetry
|
|
poetry
|
|
|
EOT
|
|
EOT
|
|
|
- pip install -r /tmp/requirements.txt
|
|
|
|
|
|
|
+ pip install -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple -r /tmp/requirements.txt
|
|
|
|
|
|
|
|
# Cleanup
|
|
# Cleanup
|
|
|
rm -rf /var/tmp/* \
|
|
rm -rf /var/tmp/* \
|
|
@@ -263,7 +269,7 @@ RUN set -eux; \
|
|
|
;; \
|
|
;; \
|
|
|
esac; \
|
|
esac; \
|
|
|
echo "Installing s6-overlay ${S6_OVERLAY_VERSION} for arch: ${S6_ARCH} (from TARGETARCH=${TARGETARCH})"; \
|
|
echo "Installing s6-overlay ${S6_OVERLAY_VERSION} for arch: ${S6_ARCH} (from TARGETARCH=${TARGETARCH})"; \
|
|
|
- base_url="https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}"; \
|
|
|
|
|
|
|
+ base_url="https://gh-proxy.com/https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}"; \
|
|
|
for pkg in noarch ${S6_ARCH}; do \
|
|
for pkg in noarch ${S6_ARCH}; do \
|
|
|
wget -q -O "/tmp/s6-overlay-${pkg}.tar.xz" "${base_url}/s6-overlay-${pkg}.tar.xz"; \
|
|
wget -q -O "/tmp/s6-overlay-${pkg}.tar.xz" "${base_url}/s6-overlay-${pkg}.tar.xz"; \
|
|
|
done \
|
|
done \
|
|
@@ -316,11 +322,11 @@ RUN set -eux; \
|
|
|
RUN <<EOF
|
|
RUN <<EOF
|
|
|
set -eux
|
|
set -eux
|
|
|
|
|
|
|
|
- # Add PostgreSQL APT repository
|
|
|
|
|
- wget -O /tmp/ACCC4CF8.asc https://www.postgresql.org/media/keys/ACCC4CF8.asc \
|
|
|
|
|
|
|
+ # Use Tsinghua mirror for PostgreSQL APT repository
|
|
|
|
|
+ wget -O /tmp/ACCC4CF8.asc https://mirrors.tuna.tsinghua.edu.cn/postgresql/repos/apt/ACCC4CF8.asc \
|
|
|
&& gpg --dearmor /tmp/ACCC4CF8.asc \
|
|
&& gpg --dearmor /tmp/ACCC4CF8.asc \
|
|
|
&& mv /tmp/ACCC4CF8.asc.gpg /usr/share/keyrings/postgresql-archive-keyring.gpg \
|
|
&& mv /tmp/ACCC4CF8.asc.gpg /usr/share/keyrings/postgresql-archive-keyring.gpg \
|
|
|
- && echo "deb [signed-by=/usr/share/keyrings/postgresql-archive-keyring.gpg] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
|
|
|
|
|
|
|
+ && echo "deb [signed-by=/usr/share/keyrings/postgresql-archive-keyring.gpg] https://mirrors.tuna.tsinghua.edu.cn/postgresql/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
|
|
|
|
|
|
|
|
# Install
|
|
# Install
|
|
|
apt-get update -y && apt-get install -y --no-install-recommends \
|
|
apt-get update -y && apt-get install -y --no-install-recommends \
|
|
@@ -390,13 +396,13 @@ COPY docker-compose/grafana/grafana_dashboards/ /etc/dashboards/
|
|
|
|
|
|
|
|
## Install Skopeo
|
|
## Install Skopeo
|
|
|
|
|
|
|
|
-ARG GOPROXY="https://proxy.golang.org,direct"
|
|
|
|
|
|
|
+ARG GOPROXY="https://goproxy.cn,direct"
|
|
|
|
|
|
|
|
RUN <<EOF
|
|
RUN <<EOF
|
|
|
# Skopeo
|
|
# Skopeo
|
|
|
|
|
|
|
|
# Install Go
|
|
# Install Go
|
|
|
- curl --retry 3 --retry-connrefused -fL "https://go.dev/dl/go1.23.3.${TARGETOS}-${TARGETARCH}.tar.gz" | tar -zx -C /usr/local
|
|
|
|
|
|
|
+ curl --retry 3 --retry-connrefused -fL "https://golang.google.cn/dl/go1.23.3.${TARGETOS}-${TARGETARCH}.tar.gz" | tar -zx -C /usr/local
|
|
|
export PATH="/usr/local/go/bin:${PATH}"
|
|
export PATH="/usr/local/go/bin:${PATH}"
|
|
|
export GOPROXY="${GOPROXY}"
|
|
export GOPROXY="${GOPROXY}"
|
|
|
export
|
|
export
|
|
@@ -404,7 +410,7 @@ RUN <<EOF
|
|
|
# Download
|
|
# Download
|
|
|
git -C /tmp clone --recursive --shallow-submodules \
|
|
git -C /tmp clone --recursive --shallow-submodules \
|
|
|
--depth 1 --branch v1.20.0 --single-branch \
|
|
--depth 1 --branch v1.20.0 --single-branch \
|
|
|
- https://github.com/containers/skopeo.git skopeo
|
|
|
|
|
|
|
+ https://gh-proxy.com/https://github.com/containers/skopeo.git skopeo
|
|
|
|
|
|
|
|
# Build and install
|
|
# Build and install
|
|
|
pushd /tmp/skopeo \
|
|
pushd /tmp/skopeo \
|
|
@@ -464,14 +470,14 @@ RUN <<EOF
|
|
|
esac
|
|
esac
|
|
|
|
|
|
|
|
curl --retry 3 --retry-connrefused -fL \
|
|
curl --retry 3 --retry-connrefused -fL \
|
|
|
- "https://github.com/prometheus/prometheus/releases/download/v${PROMETHEUS_VERSION}/prometheus-${PROMETHEUS_VERSION}.linux-${PROM_ARCH}.tar.gz" \
|
|
|
|
|
|
|
+ "https://gh-proxy.com/https://github.com/prometheus/prometheus/releases/download/v${PROMETHEUS_VERSION}/prometheus-${PROMETHEUS_VERSION}.linux-${PROM_ARCH}.tar.gz" \
|
|
|
| tar -zx -C /opt
|
|
| tar -zx -C /opt
|
|
|
mv "/opt/prometheus-${PROMETHEUS_VERSION}.linux-${PROM_ARCH}" /opt/prometheus
|
|
mv "/opt/prometheus-${PROMETHEUS_VERSION}.linux-${PROM_ARCH}" /opt/prometheus
|
|
|
ln -s /opt/prometheus/prometheus /usr/local/bin/prometheus
|
|
ln -s /opt/prometheus/prometheus /usr/local/bin/prometheus
|
|
|
ln -s /opt/prometheus/promtool /usr/local/bin/promtool
|
|
ln -s /opt/prometheus/promtool /usr/local/bin/promtool
|
|
|
|
|
|
|
|
curl --retry 3 --retry-connrefused -fL \
|
|
curl --retry 3 --retry-connrefused -fL \
|
|
|
- "https://dl.grafana.com/oss/release/grafana-${GRAFANA_VERSION}.linux-${GRAFANA_ARCH}.tar.gz" \
|
|
|
|
|
|
|
+ "https://mirrors.tuna.tsinghua.edu.cn/grafana/oss/grafana-${GRAFANA_VERSION}.linux-${GRAFANA_ARCH}.tar.gz" \
|
|
|
| tar -zx -C /opt
|
|
| tar -zx -C /opt
|
|
|
mv "/opt/grafana-${GRAFANA_VERSION}" /opt/grafana
|
|
mv "/opt/grafana-${GRAFANA_VERSION}" /opt/grafana
|
|
|
ln -s /opt/grafana/bin/grafana-server /usr/local/bin/grafana-server
|
|
ln -s /opt/grafana/bin/grafana-server /usr/local/bin/grafana-server
|
|
@@ -510,7 +516,7 @@ RUN --mount=type=cache,target=/root/.cache \
|
|
|
WHEEL_PACKAGE="$(ls /workspace/gpustack/dist/*.whl)[audio]";
|
|
WHEEL_PACKAGE="$(ls /workspace/gpustack/dist/*.whl)[audio]";
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
- uv pip install --no-build-isolation --extra-index-url https://download.pytorch.org/whl/cpu/ \
|
|
|
|
|
|
|
+ uv pip install --no-build-isolation --extra-index-url https://download.pytorch.org/whl/cpu/ --index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple \
|
|
|
${WHEEL_PACKAGE}
|
|
${WHEEL_PACKAGE}
|
|
|
|
|
|
|
|
# Download tools
|
|
# Download tools
|
|
@@ -528,7 +534,7 @@ RUN --mount=type=cache,target=/root/.cache \
|
|
|
|
|
|
|
|
# Try to update PCI IDs
|
|
# Try to update PCI IDs
|
|
|
if ! update-pciids; then
|
|
if ! update-pciids; then
|
|
|
- curl -o /usr/share/misc/pci.ids https://pci-ids.ucw.cz/v2.2/pci.ids || true
|
|
|
|
|
|
|
+ curl -o /usr/share/misc/pci.ids https://mirrors.tuna.tsinghua.edu.cn/misc/pci.ids || true
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
# Cleanup
|
|
# Cleanup
|