一、Uninstall old versions
Older versions of Docker were called docker or docker-engine. If these are installed, uninstall them:
执行命令:sudo apt-get remove docker docker-engine docker.io
二、Install by DEB package
Install Docker CE, changing the path below to the path where you downloaded the Docker package.
$ sudo dpkg -i /path/to/package.debThe Docker daemon starts automatically.
Verify that Docker CE is installed correctly by running the
hello-worldimage.$ sudo docker run hello-world
三、Post config
To create the docker group and add your user:
Create the docker group
$ sudo groupadd dockerAdd your user to the docker group
$ sudo usermod -aG docker $USERLog out and log back in so that your group membership is re-evaluated.
If testing on a virtual machine, it may be necessary to restart the virtual machine for changes to take effect.
On a desktop Linux environment such as X Windows, log out of your session completely and then log back in.
Verify that you can run docker commands without sudo
$ docker run hello-world
docker commit id name(Registry大头的)
本文档详细介绍了如何卸载旧版本的Docker,并通过DEB包安装Docker CE。此外,还提供了创建docker组及添加用户的步骤,确保用户能够无须使用sudo即可运行docker命令。

368

被折叠的 条评论
为什么被折叠?



