4632 views
Docker-ce 版本安裝 === * 我的linux系統是Ubuntu 16.04。01 LTS 64位系統,通過apt的docker官方源安裝最新的Docker CE(Community Edition),即Docker社區版,是開發人員和小型團隊的理想選擇,可以指定安裝版本 # 開始安裝 * 由於apt官方庫裡的docker版本可能比較舊,所以先卸載可能存在的舊版本: ```shell= $ sudo apt-get remove docker docker-engine docker-ce docker.io ``` * update ```shell= $ sudo apt-get update ``` * 使apt可以通過HTTPS使用存儲庫(repository): ```shell= $ sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common ``` * 添加Docker官方的GPG密鑰: ```shell= $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - ``` * 更新APT ```shell= $ sudo apt-get update ``` * 需要安裝一個特定版本的Docker CE,而不是總是使用最新版本:列出可用的版本: ```shell= $ apt-cache madison docker-ce ``` ![](https://minio.mcl.math.ncu.edu.tw:443/hackmd/uploads/upload_5d5b37844855bec3384badd16b09d082.png) * 安裝docker ```shell= $ sudo apt-get install docker-ce=18.06.3~ce~3-0~ubuntu ``` * 查看docker ```shell= $ systemctl status docker ``` ![](https://minio.mcl.math.ncu.edu.tw:443/hackmd/uploads/upload_e9dac253e46290dfc855871a80a41b2c.png) * 若未啟動,則啟動docker服務: ```shell= $ sudo systemctl start docker ```