zoukankan      html  css  js  c++  java
  • docker系列2-centos7下安装docker

    1、卸载旧版本,没有安装过则跳过

    $ sudo yum remove docker 
                      docker-client 
                      docker-client-latest 
                      docker-common 
                      docker-latest 
                      docker-latest-logrotate 
                      docker-logrotate 
                      docker-engine

    2、从远程仓库安装

    安装yum-utils工具包(包含了yum-config-manager工具)

    $ sudo yum install -y yum-utils

    安装stable仓库(必须安装)

    $ sudo yum-config-manager  --add-repo  https://download.docker.com/linux/centos/docker-ce.repo

    2.1、可选操作:

    启用nightly、test仓库

    $ sudo yum-config-manager --enable docker-ce-test
    $ sudo yum-config-manager --enable docker-ce-nightly

    禁用用nightly仓库

    $ sudo yum-config-manager --disable docker-ce-nightly

    3、安装docker engine 默认安装最新版

    $ sudo yum install docker-ce docker-ce-cli containerd.io

    1)假如需要安装指定版本则,先查出可安装的版本列表,从高到低排列

    $ yum list docker-ce --showduplicates | sort -r

    2)指定版本安装

    $ sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io

    4、启动docker

    $ sudo systemctl start docker

    5、查看安装版本

    $ docker version

    6、运行hello-world image 测试docker是否正确安装

    $ sudo docker run hello-world
    [root@bogon network-scripts]# sudo docker run hello-world
    Unable to find image 'hello-world:latest' locally
    latest: Pulling from library/hello-world
    0e03bdcc26d7: Already exists 
    Digest: sha256:8e3114318a995a1ee497790535e7b88365222a21771ae7e53687ad76563e8e76
    Status: Downloaded newer image for hello-world:latest
    Hello from Docker!
    This message shows that your installation appears to be working correctly.
    To generate this message, Docker took the following steps:
     1. The Docker client contacted the Docker daemon.
     2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
        (amd64)
     3. The Docker daemon created a new container from that image which runs the
        executable that produces the output you are currently reading.
     4. The Docker daemon streamed that output to the Docker client, which sent it
        to your terminal.
    To try something more ambitious, you can run an Ubuntu container with:
     $ docker run -it ubuntu bash
    Share images, automate workflows, and more with a free Docker ID:
     https://hub.docker.com/
    For more examples and ideas, visit:
     https://docs.docker.com/get-started/

    官方文档:https://docs.docker.com/engine/install/centos/

    配置阿里云的镜像加速器

  • 相关阅读:
    npm start 时报 node_modules/nan 错误
    webpack 插件依赖
    reducer-form 数组字段 在removeField/removeField 之后 dirty 不改变的问题
    sass 入门教程
    解决国内gem不能用的问题
    nrm 快速切换 NPM 源
    数值补全指定位数
    文本溢出使用省略号
    css/js效果笔记
    用MyEclipse,只要一开css文件就报错,按下任何键都报错
  • 原文地址:https://www.cnblogs.com/zh-ch/p/12870835.html
Copyright © 2011-2022 走看看