在购买一台海外 VPS 之后,有很多一键脚本可以测试 IP 质量,例如 IPQuality
但一键脚本便利的同时也是黑盒子,安全起见,通常是测试完脚本就重装系统以确保服务器后续安全
但像测速之类的脚本,完全可以在 docker 中运行一次性容器来运行脚本,在运行结束后容器也随之结束,可以避免重装系统的麻烦
下面以在 debian12 中使用容器来运行一键脚本测速为例,在 debian12 中安装 docker:
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
然后运行一次性容器:
docker run --rm -it --network host debian:12 bash
在容器内运行脚本
bash <(curl -sL Check.Place) -I