我已经安装了 Ubuntu 17.04 (VirtualBox)。但由于我使用的是 Ubuntu 17.04,所以似乎 docker 还不适用于 Ubuntu 17.04。有没有在 Ubuntu 17.04 上安装 Docker 的解决方法?
这是我的命令行历史记录:
2 curl -L https://github.com/docker/machine/releases/download/v0.10.0/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine && chmod +x /tmp/docker-machine && sudo cp /tmp/docker-machine /usr/local/bin/docker-machine
3 docker-machine version
4 docker pull ubuntu:latest
5 sudo apt-get update
6 sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
7 sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
8 sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
9 sudo apt-key fingerprint 0EBFCD88
10 lsb_release -cs
11 sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
12 sudo apt-get update
13 sudo apt-get install docker-ce -y
这是实际的错误:
user@user-vm:~$ sudo apt-get update
Hit:1 http://ch.archive.ubuntu.com/ubuntu zesty InRelease
Hit:2 http://ch.archive.ubuntu.com/ubuntu zesty-updates InRelease
Get:3 http://security.ubuntu.com/ubuntu zesty-security InRelease [89.2 kB]
Hit:4 http://ch.archive.ubuntu.com/ubuntu zesty-backports InRelease
Ign:5 https://download.docker.com/linux/ubuntu zesty InRelease
Ign:6 https://download.docker.com/linux/ubuntu zesty Release
Ign:7 https://download.docker.com/linux/ubuntu zesty/stable all Packages
Ign:8 https://download.docker.com/linux/ubuntu zesty/stable amd64 Packages
Ign:9 https://download.docker.com/linux/ubuntu zesty/stable Translation-en_US
Ign:10 https://download.docker.com/linux/ubuntu zesty/stable Translation-en
Ign:11 https://download.docker.com/linux/ubuntu zesty/stable all DEP-11 Metadata
Ign:12 https://download.docker.com/linux/ubuntu zesty/stable amd64 DEP-11 Metadata
Ign:13 https://download.docker.com/linux/ubuntu zesty/stable DEP-11 64x64 Icons
Ign:7 https://download.docker.com/linux/ubuntu zesty/stable all Packages
Ign:8 https://download.docker.com/linux/ubuntu zesty/stable amd64 Packages
Ign:9 https://download.docker.com/linux/ubuntu zesty/stable Translation-en_US
Ign:10 https://download.docker.com/linux/ubuntu zesty/stable Translation-en
Ign:11 https://download.docker.com/linux/ubuntu zesty/stable all DEP-11 Metadata
Ign:12 https://download.docker.com/linux/ubuntu zesty/stable amd64 DEP-11 Metadata
Ign:13 https://download.docker.com/linux/ubuntu zesty/stable DEP-11 64x64 Icons
Ign:7 https://download.docker.com/linux/ubuntu zesty/stable all Packages
Ign:8 https://download.docker.com/linux/ubuntu zesty/stable amd64 Packages
Ign:9 https://download.docker.com/linux/ubuntu zesty/stable Translation-en_US
Ign:10 https://download.docker.com/linux/ubuntu zesty/stable Translation-en
Ign:11 https://download.docker.com/linux/ubuntu zesty/stable all DEP-11 Metadata
Ign:12 https://download.docker.com/linux/ubuntu zesty/stable amd64 DEP-11 Metadata
Ign:13 https://download.docker.com/linux/ubuntu zesty/stable DEP-11 64x64 Icons
Ign:7 https://download.docker.com/linux/ubuntu zesty/stable all Packages
Ign:8 https://download.docker.com/linux/ubuntu zesty/stable amd64 Packages
Ign:9 https://download.docker.com/linux/ubuntu zesty/stable Translation-en_US
Ign:10 https://download.docker.com/linux/ubuntu zesty/stable Translation-en
Ign:11 https://download.docker.com/linux/ubuntu zesty/stable all DEP-11 Metadata
Ign:12 https://download.docker.com/linux/ubuntu zesty/stable amd64 DEP-11 Metadata
Ign:13 https://download.docker.com/linux/ubuntu zesty/stable DEP-11 64x64 Icons
Ign:7 https://download.docker.com/linux/ubuntu zesty/stable all Packages
Ign:8 https://download.docker.com/linux/ubuntu zesty/stable amd64 Packages
Ign:9 https://download.docker.com/linux/ubuntu zesty/stable Translation-en_US
Ign:10 https://download.docker.com/linux/ubuntu zesty/stable Translation-en
Ign:11 https://download.docker.com/linux/ubuntu zesty/stable all DEP-11 Metadata
Ign:12 https://download.docker.com/linux/ubuntu zesty/stable amd64 DEP-11 Metadata
Ign:13 https://download.docker.com/linux/ubuntu zesty/stable DEP-11 64x64 Icons
Ign:7 https://download.docker.com/linux/ubuntu zesty/stable all Packages
Err:8 https://download.docker.com/linux/ubuntu zesty/stable amd64 Packages
404 Not Found
Ign:9 https://download.docker.com/linux/ubuntu zesty/stable Translation-en_US
Ign:10 https://download.docker.com/linux/ubuntu zesty/stable Translation-en
Ign:11 https://download.docker.com/linux/ubuntu zesty/stable all DEP-11 Metadata
Ign:12 https://download.docker.com/linux/ubuntu zesty/stable amd64 DEP-11 Metadata
Ign:13 https://download.docker.com/linux/ubuntu zesty/stable DEP-11 64x64 Icons
Fetched 89.2 kB in 12s (7'258 B/s)
Reading package lists... Done
W: The repository 'https://download.docker.com/linux/ubuntu zesty Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch https://download.docker.com/linux/ubuntu/dists/zesty/stable/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
答案1
Docker 尚未为最新的 ubuntu 设置存储库,但这很容易解决,因为它们的 ubuntu 16 版本兼容。目前,只需编辑/etc/apt/sources.list
并在线:
deb [arch=amd64] https://download.docker.com/linux/ubuntu zesty stable
替换zesty
为xenial
。运行sudo apt-get update
,然后您就可以继续sudo apt-get install docker-ce
答案2
只需快速说明一下:目前要在 ubuntu 17.04 (zesty) 上安装 docker-ce,您需要处于边缘通道:请参阅https://github.com/moby/moby/issues/32423#issuecomment-300164496
因此您需要添加deb [arch=amd64] https://download.docker.com/linux/ubuntu zesty edge
到您的来源。
答案3
本主题中的信息已过时,可能会导致 docker 安装失败;现在支持 ubuntu zesty,并且有可用的软件包;请参阅安装手册:https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
卸载旧版本
旧版本的 Docker 称为docker
或docker-engine
。如果安装了这些,请卸载它们:
$ sudo apt-get remove docker docker-engine docker.io
自动安装
如果您希望所有安装步骤“自动”完成,您也可以使用安装脚本https://get.docker.com/
使用存储库安装
更新 apt 包索引:
$ sudo apt-get update
安装软件包以允许 apt 通过 HTTPS 使用存储库:
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
添加Docker的官方GPG密钥:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
验证密钥指纹是否9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88.
$ sudo apt-key fingerprint 0EBFCD88
pub 4096R/0EBFCD88 2017-02-22
Key fingerprint = 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid Docker Release (CE deb) <[email protected]>
sub 4096R/F273FCD8 2017-02-22
使用以下命令设置稳定的存储库(针对架构amd64
):
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
安装 DOCKER CE
$ sudo apt-get update
$ sudo apt-get install docker-ce
感谢 Sebastiaan van Stijn 对我的帮助。
答案4
我终于成功了。以下是对我有用的解决方案:
使用Ravexina提出的解决方案:
sudo apt install docker.io
然后使用这个:
sudo gpasswd -a ${USER} docker
最后,重启我的系统
瞧...它运行完美。