Ubuntu18.04通过.deb包安装Docker

通过参照官方文档和一点小摸索出来的,记录一下。

  1. 下载包,总共需要下载三个,可以在https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/上选择最新版:
    1. https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/containerd.io_1.2.0-1_amd64.deb
    2. https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/docker-ce-cli_18.09.0~3-0~ubuntu-bionic_amd64.deb
    3. https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/docker-ce_18.09.0~3-0~ubuntu-bionic_amd64.deb
  2. 将三个包放到Linux的某个文件夹下,此处用的是命令的方式,注意将“[email protected]:/home/sysadm/”换成自己的:
    1. scp containerd.io_1.2.0-1_amd64.deb [email protected]:/home/sysadm/
    2. scp docker-ce-cli_18.09.0~3-0~ubuntu-bionic_amd64.deb [email protected]:/home/sysadm/
    3. scp docker-ce_18.09.0~3-0~ubuntu-bionic_amd64.deb [email protected]:/home/sysadm/
  3. 安装libltdl7:
    1. sudo apt-get install libltdl7
  4. 按顺序安装三个包,注意顺序不能错:
    1. sudo dpkg -i docker-ce-cli_18.09.0~3-0~ubuntu-bionic_amd64.deb
    2. sudo dpkg -i containerd.io_1.2.0-1_amd64.deb
    3. sudo dpkg -i docker-ce_18.09.0~3-0~ubuntu-bionic_amd64.deb
  5. docker --version

 

你可能感兴趣的:(Linux)