使用apt安裝docker
# 更新數據源 apt-get update # 安裝所需依賴 apt-get -y install apt-transport-https ca-certificates curl software-properties-common #安裝GPG證書 curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add - #新增數據源 add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" #更新並安裝docker apt-get update && apt-get install -y docker-ce # 驗證安裝 docker version