Loading... **安装一些必要的系统工具** ```bash sudo apt update sudo apt upgrade -y sudo apt -y install curl vim wget gnupg dpkg apt-transport-https lsb-release ca-certificates ``` **更新并安装 Docker-CE** ```bash sudo apt -y install docker.io ``` **开启Docker服务,并设置开机自启** ```bash sudo service docker start sudo systemctl enable docker ``` **配置Docker镜像加速器** 您可以通过修改daemon配置文件/etc/docker/daemon.json来使用加速器 ```bash sudo tee /etc/docker/daemon.json <<-'EOF' {"registry-mirrors": ["https://hub-mirror.c.163.com"]} EOF sudo systemctl daemon-reload sudo systemctl restart docker docker info ``` 如果加速后依然很慢修改DNS配置为 8.8.8.8 **安装 docker-compose** ```bash sudo curl -L "https://github.com/docker/compose/releases/download/v2.26.1/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose docker-compose --version ``` 最后修改:2024 年 08 月 16 日 © 允许规范转载 赞 如果觉得我的文章对你有用,请点个赞哦