deb-packs/docker/package.sh

114 lines
3.4 KiB
Bash
Raw Permalink Normal View History

2024-12-14 15:21:21 +08:00
#!/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
2024-12-20 18:09:02 +08:00
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
2024-12-14 15:21:21 +08:00
# 下载原包
echo "下载原包..."
2025-01-16 12:01:06 +08:00
wget "${base_url}/${deb_arch}/containerd.io_1.7.25-1_${deb_arch}.deb" -O containerd.io.deb
2024-12-14 15:21:21 +08:00
2024-12-20 18:09:02 +08:00
wget "${base_url}/${deb_arch}/docker-buildx-plugin_0.19.3-1~debian.12~bookworm_${deb_arch}.deb" -O docker-buildx-plugin.deb
2024-12-14 15:21:21 +08:00
2025-01-16 12:01:06 +08:00
wget "${base_url}/${deb_arch}/docker-ce-cli_27.5.0-1~debian.12~bookworm_${deb_arch}.deb" -O docker-ce-cli.deb
2024-12-14 15:21:21 +08:00
2025-01-16 12:01:06 +08:00
wget "${base_url}/${deb_arch}/docker-ce-rootless-extras_27.5.0-1~debian.12~bookworm_${deb_arch}.deb" -O docker-ce-rootless-extras.deb
2024-12-14 15:21:21 +08:00
2025-01-16 12:01:06 +08:00
wget "${base_url}/${deb_arch}/docker-ce_27.5.0-1~debian.12~bookworm_${deb_arch}.deb" -O docker-ce.deb
2024-12-14 15:21:21 +08:00
2025-01-16 12:01:06 +08:00
wget "${base_url}/${deb_arch}/docker-compose-plugin_2.32.3-1~debian.12~bookworm_${deb_arch}.deb" -O docker-compose-plugin.deb
2024-12-14 15:21:21 +08:00
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
2024-12-20 18:09:02 +08:00
if [ -f "docker-scan-plugin.deb" ]; then
apt deb docker-scan-plugin.deb
rm -v docker-scan-plugin.deb
sed -i "s/Docker <support@docker.com>/Yutent <yutent.io@gmail.com>/" docker-scan-plugin/DEBIAN/control
fi
2024-12-14 15:21:21 +08:00
fi
2024-12-20 18:09:02 +08:00
if [ -f "docker-buildx-plugin.deb" ]; then
apt deb docker-buildx-plugin.deb
rm -v docker-buildx-plugin.deb
sed -i "s/Docker <support@docker.com>/Yutent <yutent.io@gmail.com>/" docker-buildx-plugin/DEBIAN/control
2024-12-14 15:21:21 +08:00
fi
2024-12-20 18:09:02 +08:00
if [ -f "docker-ce-cli.deb" ]; then
apt deb docker-ce-cli.deb
rm -v docker-ce-cli.deb
sed -i "s/Docker <support@docker.com>/Yutent <yutent.io@gmail.com>/" docker-ce-cli/DEBIAN/control
2024-12-14 15:21:21 +08:00
fi
2024-12-20 18:09:02 +08:00
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 <support@docker.com>/Yutent <yutent.io@gmail.com>/" 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 <support@docker.com>/Yutent <yutent.io@gmail.com>/" 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 <support@docker.com>/Yutent <yutent.io@gmail.com>/" docker-compose-plugin/DEBIAN/control
fi
2024-12-14 15:21:21 +08:00
echo "完成^_^"
2024-12-20 18:09:02 +08:00
echo ""
2024-12-14 15:21:21 +08:00
echo "手动调整版本号, 然后执行打包命令"
fi
fi