Ubuntu Trusty 14.04 (LTS) 下面安装docker

2015-09-11 10:49:23
王春生
190554
最后编辑:王春生 于 2015-09-11 10:59:36
简介:本篇文章介绍如何在Ubuntu Trusty 14.04 (LTS) 下面安装docker。

编者按:docker的发展非常迅速,apt源的更新往往比较滞后。所以docker官网推荐的安装方式都是下载docker安装脚本安装。

依赖关系:

Ubuntu 14.04版本无需安装额外的依赖包,可以直接安装。

安装步骤:

  1. 使用管理员帐号登录ubuntu 14.04系统,保证该管理有root权限,或者可以执行sudo命令。

  2. 检查curl包有没有安装。

                      $ which curl

    如果curl没有安装的话,更新apt源之后,安装curl包。

    $ sudo apt-
                      get 
                      update $ sudo apt-
                      get install curl
  3. 获得最新的docker安装包。

    $ curl -sSL http
                  s://
                  get.docker.
                  com/ | 
                  sh 

    shell会提示你输入sudo的密码,然后开始执行安装过程。

  4. 确认Docker是否安装成功。

    $ sudo docker 
              run hello-world

    这个命令会下载一个测试用的镜像并启动一个容器运行它。

评论列表
xiaofenh 2017-12-12 22:57:45


安装失败,显示如下log:
xfhu@ubuntu:~$ uname -a
Linux ubuntu 4.2.0-42-generic #49~14.04.1-Ubuntu SMP Wed Jun 29 20:22:11 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
xfhu@ubuntu:~$ which curl
/usr/bin/curl
xfhu@ubuntu:~$ curl -sSL https://get.docker.com/ | sh
# Executing docker install script, commit: 11aa13e
+ sudo -E sh -c apt-get update -qq >/dev/null
+ sudo -E sh -c apt-get install -y -qq apt-transport-https ca-certificates curl software-properties-common >/dev/null
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "zh_CN:en_US:en",
LC_ALL = (unset),
LC_TIME = "zh_CN.UTF-8",
LC_MONETARY = "zh_CN.UTF-8",
LC_ADDRESS = "zh_CN.UTF-8",
LC_TELEPHONE = "zh_CN.UTF-8",
LC_NAME = "zh_CN.UTF-8",
LC_MEASUREMENT = "zh_CN.UTF-8",
LC_IDENTIFICATION = "zh_CN.UTF-8",
LC_NUMERIC = "zh_CN.UTF-8",
LC_PAPER = "zh_CN.UTF-8",
LANG = "zh_CN.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Traceback (most recent call last):
File "/usr/bin/pycompile", line 35, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
File "/usr/share/python/debpython/version.py", line 24, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package software-center (--configure):
subprocess installed post-installation script returned error exit status 1
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
WARNING: Skipping duplicate certificate Go_Daddy_Class_2_CA.pem
WARNING: Skipping duplicate certificate Go_Daddy_Class_2_CA.pem
Errors were encountered while processing:
software-center
E: Sub-process /usr/bin/dpkg returned an error code (1)
kaku 2016-03-19 21:58:14
不在root用户下, 没有使用sudo 也可能出现这种情况
wangyi 2016-03-14 11:03:01
keyserver.ubuntu.com使用非标准的11371端口,而一般公司的防火墙都屏蔽掉了该端口,而允许标准的80端口。

所以可以以如下方式强行使用80端口添加软件源:

seagull@seagull-desktop:~$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 AAAD1D3563E5A736A4F561EE884D6308E89713C4

红色部分是你要请求的Key.

通过如上方式你可成功导入key.
$ sudo add-apt-repository ppa:tiheum/equinox
[sudo] password for mislay:

更多信息: https://launchpad.net/~tiheum/+archive/ubuntu/equinox
按回车继续或者 Ctrl+c 取消添加

gpg: 钥匙环‘/tmp/tmpuhislie8/secring.gpg’已建立
gpg: 钥匙环‘/tmp/tmpuhislie8/pubring.gpg’已建立
gpg: 下载密钥‘4631BBEA’,从 hkp 服务器 keyserver.ubuntu.com
gpg: /tmp/tmpuhislie8/trustdb.gpg:建立了信任度数据库
gpg: 密钥 4631BBEA:公钥“Launchpad equinoxart”已导入
gpg: 合计被处理的数量:1
gpg:
再执行 $ curl -sSL https://get.docker.com/ | sh
slg 2016-01-29 15:00:11
curl: (7) Failed to connect to get.docker.com port 443: 拒绝连接
slg 2016-01-29 14:55:45
curl 这条命令不能执行成功,提示不能连接 是什么原因?
家勇 2016-01-26 13:54:47
Unable to find image 'hello-world:latest' locally
Pulling repository docker.io/library/hello-world
Error while pulling image: Get https://index.docker.io/v1/repositories/library/hello-world/images: x509: certificate is valid for FG3K6C3A15800021, not index.docker.io
manlsea 2015-12-17 09:05:27
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
Ubuntu Trusty 14.04.3 amd64
王春生 2015-12-22 09:34:54
docker服务没有启动吧。
bigant 2016-02-24 16:44:41
重启下机器就好了
宋文健 2015-11-27 17:04:35
安装了curl包后。获取docker安装包时curl: /usr/lib/x86_64-linux-gnu/libcurl.so.4: no version information available (required by curl)
curl: (1) Protocol https not supported or disabled in libcurl
有没有不通过curl下载的方法。。
王春生 2015-12-02 09:00:37
你用wget下载也行。就是一个安装脚本吧。
sunstear 2015-12-30 21:55:48
没有装openssl
newbee 2015-11-24 09:42:13
按照上述方法安装好docker之后,运行docker run hello-world Cannot connect to the Docker daemon. Is the docker daemon running on this host?这是怎么回事呀
王春生 2015-11-25 13:11:23
docker服务没有启动。
LTS 2015-12-16 09:46:12
sudo docker -d
1/1
发表评论
柒 乘 肆 =
评论通过审核后显示。