Ubuntu14.04下安装docker 1.9
2017-02-03 12:18
239 查看
有以下几种方式:
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.serviceroot@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下安装docker 1.9
- 阿里云 ubuntu 14.04 模板上安装 docker
- Docker - 在Ubuntu 14.04 Server上的安装Docker
- Ubuntu Server 14.04安装docker
- ubuntu14.04,安装docker(源代码管理工具)
- 在Ubuntu Trusty 14.04 (LTS) (64-bit)安装Docker
- Ubuntu14.04(32位)下安装使用docker
- 在VMware上安装Ubuntu14.04 , Docker
- 在Ubuntu 14.04安装和使用Docker
- Daocloud姿势安装docker到vmware虚拟机ubuntu14.04上
- ubuntu14.04,安装docker(源代码管理工具)
- Ubuntu14.04环境下,Docker安装
- ubuntu 14.04安装docker
- 在Ubuntu Trusty 14.04 (LTS) (64-bit)安装Docker
- ubuntu14.04安装docker
- Ubuntu14.04安装Docker及构建私有仓库
- ubuntu14.04安装docker及升级docker
- 在Ubuntu Trusty 14.04 (LTS) (64-bit)安装Docker
- ubuntu 14.04 安装docker