安装
# apt + ntp
curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-apt.sh | bash
# docker-ce
curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-docker.sh | bash
# npm
curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-npm.sh | bash
# pip
curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-pip.sh | bash
# git
curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-git.sh | bash
# 初始化全部
curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-all.sh | bash
Python 镜像源配置测试
pip config set global.index-url https://mirrors.martin98.com/repository/pypi-group/simple
NPM
npm config set registry https://mirrors.martin98.com/repository/npm-group/
dockerfile
DEB822 格式
RUN --mount=type=cache,target=/var/cache/apt \
--mount=type=cache,target=/var/lib/apt \
APT_OPTIONS="-o Acquire::https::mirrors.martin98.com::Verify-Peer=false -o Acquire::https::mirrors.martin98.com::Verify-Host=false" \
type=$(cat /etc/*release | grep ^ID= | cut -d= -f2) && \
sed -i '6,$d' /etc/apt/sources.list.d/${type}.sources && \
sed -i "s|http://deb.debian.org/debian|https://mirrors.martin98.com/repository/${type}-tsinghua/|g" /etc/apt/sources.list.d/${type}.sources && \
apt update $APT_OPTIONS && apt install $APT_OPTIONS -y ca-certificates curl && update-ca-certificates
传统格式
RUN --mount=type=cache,target=/var/cache/apt \
--mount=type=cache,target=/var/lib/apt \
APT_OPTIONS="-o Acquire::https::mirrors.martin98.com::Verify-Peer=false -o Acquire::https::mirrors.martin98.com::Verify-Host=false" \
type=$(cat /etc/*release | grep ^ID= | cut -d= -f2) && \
release=$(cat /etc/*release | grep VERSION_CODENAME | cut -d= -f2) && \
components=$([ "${type}" = "debian" ] && echo "main contrib non-free non-free-firmware" || ([ "${type}" = "ubuntu" ] && echo "main restricted universe multiverse")) && \
echo "deb https://mirrors.martin98.com/repository/${type}-tsinghua-${release}${suite#noble}/ ${suite} ${components}"
echo "deb https://mirrors.martin98.com/repository/${type}-tsinghua-${release}/ ${suite} ${components}"
sed -i '6,$d' /etc/apt/sources.list.d/${type}.sources && \
sed -i "s|http://deb.debian.org/debian|https://mirrors.martin98.com/repository/${type}-tsinghua/|g" /etc/apt/sources.list.d/${type}.sources && \
apt update $APT_OPTIONS && apt install $APT_OPTIONS -y ca-certificates && update-ca-certificates
进入容器
docker compose run debian bash
docker compose run ubuntu bash
APT 镜像源配置测试
docker compose run debian ./init-all.sh
docker compose run ubuntu ./init-all.sh
docker compose run ubuntu-2204 ./init-all.sh
Description
0.1.3
Latest
Languages
Shell
99.9%