docker 解除安裝、安裝及配置
一、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.deb
The Docker daemon starts automatically.
Verify that Docker CE is installed correctly by running the
hello-world
image.$ sudo docker run hello-world
三、Post config
To create the docker group and add your user:
Create the docker group
$ sudo groupadd docker
Add your user to the docker group
$ sudo usermod -aG docker $USER
Log 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大頭的)