# docker 設定筆記 Ubuntu 16 個人使用 Ubuntu 16 安裝 docker 的簡單筆記 ## 安裝 使用以下指令用腳本安裝 ```sh wget -qO- https://softwaresing.github.io/linux-install/docker.sh | bash ``` 上面的內容等同於 ↓ ```sh= # https://docs.docker.com/install/linux/docker-ce/ubuntu/ # Uninstall old versions sudo apt remove docker docker-engine docker.io containerd runc sudo apt update sudo apt install -y 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 sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" sudo apt update sudo apt install -y docker-ce docker-ce-cli containerd.io sudo docker run hello-world ``` ## 將使用者加入群組 安裝完後若直接使用,會出現以下訊息 ```shell docker: Got permission denied while trying to connect to the Docker daemon socket at unix ``` 可以直接用 sudo 執行 docker ,就不有問題 或是將使用者加入群組 ```sh sudo gpasswd -a ${USER} docker ``` 接著重開機就可以了 (不重開的方法請看參考文章內說明) #### 參考文章 [解決 ERROR:Docker Got permission denied while trying to connect to the Docker daemon socket at unix://](https://www.itread01.com/content/1550399257.html)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up