#!/bin/bash base_url="https://download.docker.com/linux/debian/dists/bookworm/pool/stable" deb_arch="amd64" if [ "$1" == "arm" ]; then deb_arch="arm64" fi if [ "$1" == "pack" ]; then # 不一定有, 只有amd64有这个包 if [ -d "docker-scan-plugin" ]; then apt deb docker-scan-plugin sudo rm -rf docker-scan-plugin fi apt deb docker-buildx-plugin apt deb docker-ce-cli apt deb docker-ce-rootless-extras apt deb docker-ce apt deb docker-compose-plugin sudo rm -rf docker-buildx-plugin sudo rm -rf docker-ce-cli sudo rm -rf docker-ce-rootless-extras sudo rm -rf docker-ce sudo rm -rf docker-compose-plugin echo "全部打包完成 :)" else if [ "$deb_arch" == "amd64" ] || [ "$deb_arch" == "arm64" ]; then sudo rm -rf docker-buildx-plugin sudo rm -rf docker-ce-cli sudo rm -rf docker-ce-rootless-extras sudo rm -rf docker-ce sudo rm -rf docker-compose-plugin # 下载原包 echo "下载原包..." # wget "${base_url}/${deb_arch}/containerd.io_1.7.24-1_${deb_arch}.deb" -O containerd.io.deb wget "${base_url}/${deb_arch}/docker-buildx-plugin_0.19.3-1~debian.12~bookworm_${deb_arch}.deb" -O docker-buildx-plugin.deb wget "${base_url}/${deb_arch}/docker-ce-cli_27.4.1-1~debian.12~bookworm_${deb_arch}.deb" -O docker-ce-cli.deb wget "${base_url}/${deb_arch}/docker-ce-rootless-extras_27.4.1-1~debian.12~bookworm_${deb_arch}.deb" -O docker-ce-rootless-extras.deb wget "${base_url}/${deb_arch}/docker-ce_27.4.1-1~debian.12~bookworm_${deb_arch}.deb" -O docker-ce.deb wget "${base_url}/${deb_arch}/docker-compose-plugin_2.32.1-1~debian.12~bookworm_${deb_arch}.deb" -O docker-compose-plugin.deb if [ "$deb_arch" == "amd64" ]; then wget "${base_url}/${deb_arch}/docker-scan-plugin_0.23.0~debian-bookworm_${deb_arch}.deb" -O docker-scan-plugin.deb fi echo "完成^_^" echo "" # 解包 echo "解包..." if [ "$deb_arch" == "amd64" ]; then if [ -f "docker-scan-plugin.deb" ]; then apt deb docker-scan-plugin.deb rm -v docker-scan-plugin.deb sed -i "s/Docker /Yutent /" docker-scan-plugin/DEBIAN/control fi fi if [ -f "docker-buildx-plugin.deb" ]; then apt deb docker-buildx-plugin.deb rm -v docker-buildx-plugin.deb sed -i "s/Docker /Yutent /" docker-buildx-plugin/DEBIAN/control fi if [ -f "docker-ce-cli.deb" ]; then apt deb docker-ce-cli.deb rm -v docker-ce-cli.deb sed -i "s/Docker /Yutent /" docker-ce-cli/DEBIAN/control fi if [ -f "docker-ce-rootless-extras.deb" ]; then apt deb docker-ce-rootless-extras.deb rm -v docker-ce-rootless-extras.deb sed -i "s/Docker /Yutent /" docker-ce-rootless-extras/DEBIAN/control fi if [ -f "docker-ce.deb" ]; then apt deb docker-ce.deb rm -v docker-ce.deb sed -i "s/Docker /Yutent /" docker-ce/DEBIAN/control fi if [ -f "docker-compose-plugin.deb" ]; then apt deb docker-compose-plugin.deb rm -v docker-compose-plugin.deb sed -i "s/Docker /Yutent /" docker-compose-plugin/DEBIAN/control fi echo "完成^_^" echo "" echo "手动调整版本号, 然后执行打包命令" fi fi