ubuntu@VM-16-3-ubuntu:~$ for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done Reading package lists... Done Building dependency tree... Done Reading state information... Done Package 'docker.io' is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 329 not upgraded. Reading package lists... Done Building dependency tree... Done Reading state information... Done Package 'docker-doc' is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 329 not upgraded. Reading package lists... Done Building dependency tree... Done Reading state information... Done Package 'docker-compose' is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 329 not upgraded. Reading package lists... Done Building dependency tree... Done Reading state information... Done Package 'docker-compose-v2' is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 329 not upgraded. Reading package lists... Done Building dependency tree... Done Reading state information... Done Package 'podman-docker' is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 329 not upgraded. Reading package lists... Done Building dependency tree... Done Reading state information... Done Package 'containerd' is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 329 not upgraded. Reading package lists... Done Building dependency tree... Done Reading state information... Done Package 'runc' is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 329 not upgraded.
3.开始安装Docker Engine
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
ubuntu@VM-16-3-ubuntu:~$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin Reading package lists... Done Building dependency tree... Done Reading state information... Done Package docker-ce is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source
E: Package 'docker-ce' has no installation candidate E: Unable to locate package docker-ce-cli E: Unable to locate package containerd.io E: Couldn't find any package by glob 'containerd.io' E: Couldn't find any package by regex 'containerd.io' E: Unable to locate package docker-buildx-plugin E: Unable to locate package docker-compose-plugin
root@VM-16-3-ubuntu:/etc/docker# sudo docker run hello-world
Hello from Docker! This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.
To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/
For more examples and ideas, visit: https://docs.docker.com/get-started/
PS C:\Windows\system32> wsl --update 正在安装: 适用于 Linux 的 Windows 子系统 指定的服务未安装。 0.0% ] PS C:\Windows\system32> wsl --list --verbose 适用于 Linux 的 Windows 子系统没有已安装的分发版。 可以通过访问 Microsoft Store 来安装分发版: