zoukankan      html  css  js  c++  java
  • 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

     

  • 相关阅读:
    Linux.vim.多行复制、删除、剪切
    Linux.cp命令总提示是否覆盖
    关于常用mysql的文件
    requests 获取百度推广信息
    flask下载文件---文件流
    爬虫---爬虫er与反爬虫er之间的斗争 转发
    爬虫----scrapy账号登录豆瓣,并且重定向到电影界面,获取界面信息
    爬虫----表单登录
    爬虫---爬取豆瓣-科幻片-排行
    爬虫-----爬取所有国家的首都、面积 ,并保存到txt文件中
  • 原文地址:https://www.cnblogs.com/ilinuxer/p/6362427.html
Copyright © 2011-2022 走看看