From 6d0de77ae30a8705b54c7f7c236d4ab90c1a2d86 Mon Sep 17 00:00:00 2001 From: Martin <1403951401@qq.com> Date: Sat, 4 Jan 2025 14:45:10 +0800 Subject: [PATCH] =?UTF-8?q?[+]=20=E5=A2=9E=E5=8A=A0=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E9=95=9C=E5=83=8F=E6=BA=90=E7=9A=84=E8=84=9A=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + README.md | 16 ++++++++++++++++ docker-compose.yaml | 16 ++++++++++++++++ init-apt.sh | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 docker-compose.yaml create mode 100644 init-apt.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f11b75 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..2ae1197 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ + + + + + + + + + +#### 镜像源配置测试 +```bash +docker compose run debian ./init-apt.sh +``` +```bash +docker compose run ubuntu ./init-apt.sh +``` \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..41d8268 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,16 @@ + +x-app-config: &app-config + command: bash + working_dir: /app + volumes: + - ./:/app + +services: + + debian: + <<: *app-config + image: docker.martin98.com/library/debian:latest + + ubuntu: + <<: *app-config + image: docker.martin98.com/library/ubuntu:latest \ No newline at end of file diff --git a/init-apt.sh b/init-apt.sh new file mode 100644 index 0000000..7d5a601 --- /dev/null +++ b/init-apt.sh @@ -0,0 +1,33 @@ +#!/bin/bash + + + +# 配置 ubuntu 源 +if [ -f /etc/apt/sources.list.d/ubuntu.sources ]; then + cat > /etc/apt/sources.list.d/ubuntu.sources < /etc/apt/sources.list.d/debian.sources <