拿到服务器该做的事和升级docker engine

 sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo -i # 切换到 root 用户

apt update -y  # 升级 packages

apt install wget curl sudo vim git -y  # Debian 系统比较干净,安装常用的软件

安装docker 

Install Docker Engine on Debian | Docker Docs

 for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] 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

sudo docker run hello-world 

sudo dpkg -i ./containerd.io__.deb \
  ./docker-ce__.deb \
  ./docker-ce-cli__.deb \
  ./docker-buildx-plugin__.deb \
  ./docker-compose-plugin__.deb

 

 

你可能感兴趣的:(服务器,docker,运维)