From 475e251004c4d6a8cb21df881b0b43063a2260be Mon Sep 17 00:00:00 2001 From: Martin <1403951401@qq.com> Date: Sat, 4 Jan 2025 15:04:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=87=E6=A1=A3=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 18 +++++++++++++++++- init-apt.sh | 4 +--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2ae1197..4252af1 100644 --- a/README.md +++ b/README.md @@ -13,4 +13,20 @@ docker compose run debian ./init-apt.sh ``` ```bash docker compose run ubuntu ./init-apt.sh -``` \ No newline at end of file +``` +##### 直接运行 +```bash +curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-apt.sh | bash +``` +##### docker 容器中 +```bash +RUN --mount=type=cache,target=/var/cache/apt \ + --mount=type=cache,target=/var/lib/apt \ + sed -i '6,$d' /etc/apt/sources.list.d/debian.sources && \ + sed -i 's|http://deb.debian.org/debian|https://mirrors.martin98.com/repository/debian-tsinghua/|g' /etc/apt/sources.list.d/debian.sources && \ + apt update && \ + apt install -y --no-install-recommends \ + gcc \ + g++ \ + python3-dev +``` diff --git a/init-apt.sh b/init-apt.sh index 7d5a601..3db27c1 100644 --- a/init-apt.sh +++ b/init-apt.sh @@ -1,7 +1,5 @@ #!/bin/bash - - # 配置 ubuntu 源 if [ -f /etc/apt/sources.list.d/ubuntu.sources ]; then cat > /etc/apt/sources.list.d/ubuntu.sources <