zoukankan      html  css  js  c++  java
  • docker相关

    dns
    ----
    /etc/resolv.conf

    proxy
    -----
     ~/.bashrc
    export http_proxy='http://proxyxa.xxx.com.cn:80'
    export https_proxy='http://proxyxa.xxx.com.cn:80/'
    export no_proxy="10.0.0.0/8,127.0.0.1,.xxx.com.cn"


    apt source
    -----------
    sources.list

    apt proxy
    -----------
    Acquire::http::proxy "http://proxyxa.xxx.com.cn:80/";
    Acquire::https::proxy "https://proxyxa.xxx.com.cn:80/";

    apt install openssh-server

    docker
    -------
    sudo apt-get update
    sudo apt-get install
        apt-transport-https
        ca-certificates
        curl
        software-properties-common
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    sudo apt-key fingerprint 0EBFCD88
    sudo add-apt-repository
       "deb [arch=amd64] https://download.docker.com/linux/ubuntu
       $(lsb_release -cs)
       stable"
    sudo apt-get update
    apt-cache madison docker-ce
    sudo apt-get install docker-ce=17.03.3~ce-0~ubuntu-xenial

    docker-compose install
    --------------
    https://github.com/docker/compose/releases


    docker proxy
    -------------
    wang@peer2:~$ sudo mkdir -p /etc/systemd/system/docker.service.d
    wang@peer2:~$ sudo touch /etc/systemd/system/docker.service.d/http-proxy.conf
    wang@peer2:~$ sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf
    [Service]
    Environment="HTTP_PROXY=http://proxyxa.xxx.com.cn:80/" "HTTPS_PROXY=https://proxyxa.xxx.com.cn:80/"
    Environment="NO_PROXY=localhost,127.0.0.0/8,*.zte.com.cn,10.0.0.0/8"

    docker registry
    sudo vi /etc/docker/daemon.json

    {
      "registry-mirrors": ["https://registry.docker-cn.com"]
    }

    docker启动参数

    /etc/default/docker


    sudo systemctl daemon-reload
    sudo systemctl restart docker
    systemctl show --property=Environment docker


    iptables持久化

    iptables -A INPUT -p tcp/udp --dport $port -j ACCEPT
    iptables -A OUTPUT -p tcp/udp --sport $port -j ACCEPT
    sudo apt-get install iptables-persistent
    sudo netfilter-persistent save

     overlay network

    docker-node1:192.168.122.120

    docker-node2:192.168.122.155

    on node1:

    sudo nohup ./etcd-v3.0.12-linux-amd64/etcd
        --name docker-node1 --initial-advertise-peer-urls http://192.168.122.120:2380
        --listen-peer-urls http://192.168.122.120:2380
        --listen-client-urls http://192.168.122.120:2379,http://127.0.0.1:2379
        --advertise-client-urls http://192.168.122.120:2379
        --initial-cluster-token etcd-cluster
        --initial-cluster docker-node1=http://192.168.122.120:2380,docker-node2=http://192.168.122.155:2380
        --initial-cluster-state new&

    on node2:

    sudo nohup ./etcd-v3.0.12-linux-amd64/etcd
        --name docker-node2 --initial-advertise-peer-urls http://192.168.122.155:2380
        --listen-peer-urls http://192.168.122.155:2380
        --listen-client-urls http://192.168.122.155:2379,http://127.0.0.1:2379
        --advertise-client-urls http://192.168.122.155:2379
        --initial-cluster-token etcd-cluster
        --initial-cluster docker-node1=http://192.168.122.120:2380,docker-node2=http://192.168.122.155:2380
        --initial-cluster-state new&

    sudo ./etcd-v3.0.12-linux-amd64/etcdctl cluster-health

    按照这个测试未成功

     https://blog.csdn.net/qq_37880968/article/details/86747883

  • 相关阅读:
    gitblit 配置图文详解
    springmvc文件下载之文件名下划线问题终极解决方案
    redis实战进阶
    关于B+树, 你要了解的都在这里
    http的长连接和短连接(史上最通俗!)以及应用场景
    Base64的前世今生
    Springfox集成Swagger2实战篇
    Minio使用详解
    ubuntu系统五笔输入法安装
    YouTube排名第一的励志英文演讲《Dream(梦想)》
  • 原文地址:https://www.cnblogs.com/dablyo/p/11023536.html
Copyright © 2011-2022 走看看