Ubuntu14.04下安装docker 1.9

Posted ilinux_one

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu14.04下安装docker 1.9相关的知识,希望对你有一定的参考价值。

 

有以下几种方式:

 

1. 通过系统自带包安装(可能不是最新版)

 

$ sudo apt-get update 
$ sudo apt-get install -y docker.io 
$ sudo ln -sf /usr/bin/docker.io /usr/local/bin/docker 
$ sudo sed -i \'$acomplete -F _docker docker\' /etc/bash_completion.d/docker.io

 

 

 

2. 通过Docker源安装最新版本

 

复制代码
$ sudo apt-get install apt-transport-https 
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 
$ sudo bash -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" 
$ sudo apt-get update 
$ sudo apt-get install lxc-docker
复制代码

 

配置DOCKER_OPS

修改docker.service

root@docker:/opt/software/DOCKER-FILES/elasticsearch# vim  /lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.target docker.socket
Requires=docker.socket
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
EnvironmentFile=/etc/default/docker
ExecStart=/usr/bin/dockerd -H fd:// $DOCKER_OPTS
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
[Install]
WantedBy=multi-user.target

 

 
修改/etc/default/docker。
root@docker:/opt/software/DOCKER-FILES/elasticsearch# vim /etc/default/docker
# Docker Upstart and SysVinit configuration file
#
# THIS FILE DOES NOT APPLY TO SYSTEMD
#
#   Please see the documentation for "systemd drop-ins":
#   https://docs.docker.com/engine/articles/systemd/
#
# Customize location of Docker binary (especially for development testing).
#DOCKERD="/usr/local/bin/dockerd"
# Use DOCKER_OPTS to modify the daemon startup options.
#DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
DOCKER_OPTS="--insecure-registry 192.168.0.240"
# If you need Docker to use an HTTP proxy, it can also be specified here.
#export http_proxy="http://127.0.0.1:3128/"
# This is also a handy place to tweak where Docker\'s temporary files go.
#export TMPDIR="/mnt/bigdrive/docker-tmp
 

 

重启docker。
root@docker:/opt/software/DOCKER-FILES/elasticsearch# /etc/init.d/docker restart
 

 

 

使用以下命令验证安装:

 

$ docker -v
Docker version 1.9.1, build a34a1d5

 

以上是关于Ubuntu14.04下安装docker 1.9的主要内容,如果未能解决你的问题,请参考以下文章

基于Ubuntu14.04-LTS下安装docker

Ubuntu 14.04 安装LNMP(nginx/1.12.1+php7.1.9+mysql5.7.19)环境

ubuntu14.04 下安装 gsl 科学计算库

ubuntu14.04环境下利用docker搭建solrCloud集群

[原创]在Linux系统Ubuntu14.04上安装部署docker

Ubuntu 14.04 安装Docker