2、dockerインストール

4121 ワード

プラットフォームの使用
現在dockerは64ビット環境でのインストールのみをサポートしています
  • Ubuntu
  • Debian
  • RHELシリーズ
  • centos
  • Fedora


  • Ubuntu環境
    カーネルの更新
    バージョンの表示:
    uname -a
    

    3.8カーネルに更新:
    apt-get install linux-headers-3.13.0-43-generic linux-image-3.13.0-43-generic linux-headers-3.13.0-43
    

    Ubuntu起動ローダの更新:
    update-grub
    init 6
    

    Device Mapperの確認
    ここでDevice Mapperをストレージドライバとして、2.6.9カーネル以降このドライバを継承しています.ここでチェックします.
    ls -lh /sys/class/misc/device-mapper
      
    grep device-mapper /proc/device
    

    なければロード:
    modprobe dm-mod
    

    2.6バージョンのカーネル以降、ネーミングスペースのサポートが良好で、葛藤する必要はありません.
    dockerのインストール
    APTウェアハウスの追加:
    echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list
    apt-get update
    

    TrustyをUbuntuリリースに変更し、バージョンを表示する必要があります.
    lsb_release --codename | cut -f2
    

    docker 1.8.0以降、dockerのパッケージ名はlxc-dockerからdocker-engineに変更され、表示およびインストールされます.
    apt list | grep docker-engine
    apt-get install docker-engine
    
    docker infoコマンドは、正常かどうかを確認します.
    root@doushuo-virtual-machine:~# docker info
    Containers: 0
     Running: 0
     Paused: 0
     Stopped: 0
    Images: 0
    Server Version: 17.05.0-ce
    Storage Driver: aufs
     Root Dir: /var/lib/docker/aufs
     Backing Filesystem: extfs
     Dirs: 0
     Dirperm1 Supported: true
    Logging Driver: json-file
    Cgroup Driver: cgroupfs
    Plugins: 
     Volume: local
     Network: bridge host macvlan null overlay
    Swarm: inactive
    Runtimes: runc
    Default Runtime: runc
    Init Binary: docker-init
    containerd version: 9048e5e50717ea4497b757314bad98ea3763c145
    runc version: 9c2d8d184e5da67c95d601382adf14862e4f2228
    init version: 949e6fa
    Security Options:
     apparmor
    Kernel Version: 3.19.0-25-generic
    Operating System: Ubuntu 14.04.3 LTS
    OSType: linux
    Architecture: x86_64
    CPUs: 1
    Total Memory: 976.8MiB
    Name: doushuo-virtual-machine
    ID: HC3O:RZVT:6MFM:LJN5:RXC5:BUKQ:OGYH:MGP7:6BAJ:QP3Q:FGWV:XDGN
    Docker Root Dir: /var/lib/docker
    Debug Mode (client): false
    Debug Mode (server): false
    Registry: https://index.docker.io/v1/
    Experimental: false
    Insecure Registries:
     127.0.0.0/8
    Live Restore Enabled: false
    
    WARNING: No swap limit support
    

    dockerとUFW
    Ubuntuでは、UFWファイアウォールを使用している場合、デフォルトではUFWは転送されたパケットをすべて破棄し、dockerはブリッジを使用して各コンテナを管理します.UFWの構成を変更する必要があります.
    root@doushuo-virtual-machine:~# grep "DEFAULT_FORWARD_POLICY"
    DEFAULT_FORWARD_POLICY="DROP"
    

    規則をACCEPTに変更
    Red Hatとそのリリース版の環境
    環境サポート
  • REHL/centos 6以降のバージョン
  • Fedora 19およびそれ以上のバージョン
  • Oracle Linux 6およびOracle Linux 7、Unbreakableエンタープライズカーネルリリース3(3.8.13)およびそれ以上のバージョン
  • カーネルバージョンの確認
    uname -a
    Linux localhost.localdomain 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
    

    現在、すべての公式サポートされているRedhatとそのシリーズプラットフォームには、dockerをサポートするカーネルがインストールされているはずです.
    Device Mapperの確認
    grep device-mapper /proc/device
    

    インストールされていない場合は、インストールが完了したらDevice Mapperモジュールをロードします.
    yum install -y device-mapper
    modprobe dm-mod
    

    dockerのインストール
    Redhatでは、リリース版がインストールされていないのは少し異なります.Redhatとcentos環境Redhat 6/centos 6のみを考慮します.
    rpm -Uvh http://download.fadoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
    yum -y install docker-io
    

    Redhat7:
    subscription-manager repos --enable-rhel-7-server-extras-rpms
    yum install -y docker
    

    centos 7起動docker
    systemctl start docker
    docker info
    

    centos 7 POST
    systemctl enable docker
      
    chkconfig docker on
    

    Dockerユーザーインタフェース
    dockerをインストールした後、グラフィックのユーザーインタフェースを使用して管理することもできます.開発中のdockerユーザーインタフェースとwebコンソールがあります.
  • Shipyard:https://github.com/ehazlett/shipyard
  • DockerUI
  • Kitematic:WindowsとOS Xの下で使用されるGUIインタフェースツール、docker社が無料で発表した製品、docker toolboxに含まれる