1. 移除舊版
2. 設定 Docker repository$ sudo apt-get remove docker docker-engine docker.io containerd runc
3. 安裝 Docker Engine - Community$ sudo apt-get update $ sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - $ sudo apt-key fingerprint 0EBFCD88 pub rsa4096 2017-02-22 [SCEA] 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 uid [ unknown] Docker Release (CE deb) docker@docker.com sub rsa4096 2017-02-22 [S] $ sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
4. 設定權限$ sudo apt-get update $ sudo apt-get install docker-ce docker-ce-cli containerd.io
5. 檢查是否順利安裝完成$ sudo usermod -aG docker ${USER}
$ docker run hello-world
參考文章
Get Docker Engine - Community for Ubuntu
How to fix docker: Got permission denied while trying to connect to the Docker daemon socket