Skip to content

Latest commit

 

History

History
97 lines (73 loc) · 2.83 KB

02.Install.md

File metadata and controls

97 lines (73 loc) · 2.83 KB
title
在WSL上准备

检查Ubuntu 版本

androllen@DESKTOP-QKA9IF0:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04 LTS
Release:        20.04
Codename:       focal

安装 Docker

  • 在线下载

    • 更新源
    cd /etc/apt/
    sudo cp sources.list sources.list.old
    sudo vim sources.list
    deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
    
    esc / shift + ZZ
    • 更新

      sudo apt update
    • 安装

      # 当前版本是 Ubuntu 20.04 LTS 所以无法安装 docker-ce,请按照对应的 Ubuntu 版本来安装社区版
      sudo apt install docker.io
    • 卸载

      whereis docker.io
      sudo apt-get autoremove --purge docker.io
      # or
      sudo apt-get purge docker.io
      sudo rm -rf /var/lib/docker
  • 离线下载

    • 下载地址

    • 离线安装

      # 通过 `winscp ssh` 上传到 /home/androllen
      $ sudo dpkg -i containerd.io_1.2.5-1_amd64.deb
      $ sudo dpkg -i docker-ce_18.09.6_3-0_ubuntu-bionic_amd64.deb
      $ sudo dpkg -i docker-ce-cli_18.09.6_3-0_ubuntu-bionic_amd64.deb
  • VSCode

    Install VS Code Docker

  • Ubuntu 安装路径

    # Ubuntu 安装路径
    C:\Users\%USERNAME%\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\home\%USERNAME%

安装docker UI

官网地址 安装

Portainer是Docker的图形化管理工具

$ docker pull portainer/portainer
$ docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v C:\ProgramData\Portainer:/data portainer/portainer
# 访问:http://localhost:9000