zoukankan      html  css  js  c++  java
  • 在阿里云主机的Debian操作系统上安装Docker

    ## 下面命令都是以root用户执行
    
    ## 查看内核版本
    uname -a
    # Debian 3.2.0-4 x86_64
    ## 版本太低了 < 3.8
    ## 参照 http://docs.docker.com/installation/debian/ 升级内核
    
    deb http://http.debian.net/debian wheezy-backports main
    apt-get update
    apt-get install -t wheezy-backports linux-image-amd64
    
    ## 重启系统
    restart
    
    ## 安装 docker 前,需要安装 curl
    apt-get install curl
    
    ## 安装 docker
    curl -sSL https://get.docker.com/ | sh
    
    ## 重启 docker 服务.
    service docker restart
    
    ## 运行 hello world
    docker run hello-world
    
    ## 不出意外的话会出现
    # FATA[0000] Get http:///var/run/docker.sock/v1.18/containers/json?all=1: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS? 
    ## 这是docker服务没有启动
    
    service docker status
    # 会看到
    # [FAIL] Docker is not running ... failed!
    # 确实没启动
    
    ## 显示启动一下
    docker -d 
    ## 会看到
    # INFO[0000] +job serveapi(unix:///var/run/docker.sock)   
    # INFO[0000] Listening for HTTP on unix (/var/run/docker.sock) 
    # INFO[0000] +job init_networkdriver()                    
    # Could not find a free IP address range for interface 'docker0'. Please configure its address manually and run 'docker -b docker0'
    # INFO[0000] -job init_networkdriver() = ERR (1)          
    # FATA[0000] Shutting down daemon due to errors: Could not find a free IP address range for interface 'docker0'. Please configure its address manually and run 'docker -b docker0'
    
    
    ## 因为阿里云把所有内网IP都占用了。所以要改下。
    
    vi /etc/network/interfaces
    ## 把 "up route add -net 172.16.0.0 netmask 255.240.0.0 gw 10.170.191.247 dev eth0" 这一注释掉(在这一行最前面加'#')
    /etc/init.d/networking restart
    
    service docker start
    service docker status
    ## 能看到 docker is running.
    
    docker run hello-world
    ## 能看到 hello-world 启动了
    # Hello from Docker.
    # This message shows that your installation appears to be working correctly.
    
    ## 把非管理员用户添加到docker组,方便使用
    useradd -G docker <user_login>
  • 相关阅读:
    通过internet网络唤醒主机的方法
    信用风险计量模型
    Vintage、滚动率、迁移率的应用
    (信贷风控十五)评分卡分数切分、授信额度与利率定价
    (信贷风控十)催收评分卡的介绍
    (信贷风控十六)组合评分卡模型
    (信贷风控十四)深度神经网络模型用于评分卡模型(理论)
    (十三)GBDT模型用于评分卡模型python实现
    (信贷风控九)行为评分卡模型python实现
    改变jupyter notebook的主题背景
  • 原文地址:https://www.cnblogs.com/h2zZhou/p/5207826.html
Copyright © 2011-2022 走看看