在 Ubuntu 桌面 14.04 LTS 上安装 docker

在 Ubuntu 桌面 14.04 LTS 上安装 docker

我正在尝试按照以下步骤在我的 ubuntu 桌面 14.0.4 LTS 上安装 docker-engine: docker 安装网址

步骤 #11 失败(apt-cache policy docker-engine)

root@ashu-HP-ENVY-Notebook:/home/ashu# apt-get purge lxc-docker
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'lxc-docker' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
root@ashu-HP-ENVY-Notebook:/home/ashu# apt-cache policy docker-engine
docker-engine:
  Installed: (none)
  Candidate: 1.9.1-0~trusty
  Version table:
     1.9.1-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
     1.9.0-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
     1.8.3-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
     1.8.2-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
     1.8.1-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
     1.8.0-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
     1.7.1-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
     1.7.0-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
     1.6.2-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
     1.6.1-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
     1.6.0-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
     1.5.0-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages

当我访问这个位置时出现 500 错误docker 分发

我可以看到一些文件...我应该继续直接从那里安装吗?根据您过去的经验,有什么建议吗?

root@ashu-HP-ENVY-Notebook:/home/ashu# uname -r
4.2.5-040205-generic

我正在使用 Linux 内核 4.2.5 基本上安装 docker 没有起作用,有什么帮助吗?

答案1

即使在第 11 步卡住了,我还是继续执行剩余的步骤,最终成功安装。

答案2

!!! 请记住在安装/清除等之前务必备份 !!!

这是我在 16.04 上的安装步骤(直到 13之后,我还安装了 12.04 的机器):

1.sudo apt-get install apt-transport-https ca-certificates

2.sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

3.sudo touch /etc/apt/sources.list.d/docker.list

4.sudo su

A。echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" >>/etc/apt/sources.list.d/docker.list

b.exit

5.sudo cat /etc/apt/sources.list.d/docker.list

6.sudo apt-get update

7.sudo apt-get purge lxc-docker

8.sudo apt-cache policy docker-engine

9.sudo apt-get update

10.

sudo apt-get install linux-image-extra-`(uname -r)`

11.sudo apt-get update

12.sudo apt-get install docker-engine

13.sudo service docker start

14.sudo docker run ubuntu:12.04 cat /etc/issue

15. sudo cat /etc/issue #或者您也可以使用:

16. sudo docker pull ubuntu:12.04 #然后运行该图像

17. sudo docker run -i -t ubuntu:12.04 /bin/bash #验证

18. cat /etc/issue #ps 退出前不要忘记提交更改,否则会丢失。首先使用此命令获取容器 ID:

19. sudo docker ps -l #提交对容器的更改:

20. sudo docker commit <container_id> repo/img1 #然后在该容器中运行:

21.sudo docker run -i -t repo/img1 /bin/bash

相关内容