From b7926fb7b23fa249cf483697c5a5c23c872f5ce2 Mon Sep 17 00:00:00 2001 From: yutent Date: Fri, 20 Dec 2024 18:09:02 +0800 Subject: [PATCH] update docker --- docker/package.sh | 85 ++++++++++++++++++++++++++++------------------- 1 file changed, 51 insertions(+), 34 deletions(-) diff --git a/docker/package.sh b/docker/package.sh index a59e302..0935b8f 100755 --- a/docker/package.sh +++ b/docker/package.sh @@ -32,20 +32,26 @@ if [ "$1" == "pack" ]; then 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}/containerd.io_1.7.24-1_${deb_arch}.deb" -O containerd.io.deb - wget "${base_url}/${deb_arch}/docker-buildx-plugin_0.19.2-1~debian.12~bookworm_${deb_arch}.deb" -O docker-buildx-plugin.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.0-1~debian.12~bookworm_${deb_arch}.deb" -O docker-ce-cli.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.0-1~debian.12~bookworm_${deb_arch}.deb" -O docker-ce-rootless-extras.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.0-1~debian.12~bookworm_${deb_arch}.deb" -O docker-ce.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.31.0-1~debian.12~bookworm_${deb_arch}.deb" -O docker-compose-plugin.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 @@ -57,40 +63,51 @@ else # 解包 echo "解包..." if [ "$deb_arch" == "amd64" ]; then - apt deb docker-scan-plugin.deb - fi - apt deb docker-buildx-plugin.deb - apt deb docker-ce-cli.deb - apt deb docker-ce-rootless-extras.deb - apt deb docker-ce.deb - apt deb docker-compose-plugin.deb - echo "完成^_^" - echo "" + if [ -f "docker-scan-plugin.deb" ]; then + apt deb docker-scan-plugin.deb + rm -v docker-scan-plugin.deb - # 移除旧包 - echo "移除旧包..." - if [ "$deb_arch" == "amd64" ]; then - rm -v docker-scan-plugin.deb + sed -i "s/Docker /Yutent /" docker-scan-plugin/DEBIAN/control + fi fi - rm -v docker-buildx-plugin.deb - rm -v docker-ce-cli.deb - rm -v docker-ce-rootless-extras.deb - rm -v docker-ce.deb - rm -v docker-compose-plugin.deb - echo "完成^_^" - echo "" - echo "修改打包人信息..." - if [ "$deb_arch" == "amd64" ]; then - sed -i "s/Docker /Yutent /" docker-scan-plugin/DEBIAN/control + 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 - sed -i "s/Docker /Yutent /" docker-buildx-plugin/DEBIAN/control - sed -i "s/Docker /Yutent /" docker-ce-cli/DEBIAN/control - sed -i "s/Docker /Yutent /" docker-ce-rootless-extras/DEBIAN/control - sed -i "s/Docker /Yutent /" docker-ce/DEBIAN/control - sed -i "s/Docker /Yutent /" docker-compose-plugin/DEBIAN/control + 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