zoukankan      html  css  js  c++  java
  • docker安装

    一、Docker介绍与安装

    安装

    官方安装文档

    ubuntu下安装

    如果是第一次安装,你需要先添加docker的源然后再安装

    1. 更新包

      sudo apt-get update
    2.  安装证书

        

    sudo apt-get install 
        apt-transport-https 
        ca-certificates 
        curl 
        gnupg-agent 
        software-properties-common
    

      3. 添加docker的官方GPGkey  

    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    

      4. 添加docker源

    sudo add-apt-repository 
       "deb [arch=amd64] https://download.docker.com/linux/ubuntu 
       $(lsb_release -cs) 
       stable"
    

     

    安装 docker ce

      1. 更新包索引

      sudo apt-get update

      2. 安装docker

      sudo apt-get install docker-ce

      3. 检测是否安装成功

      sudo docker run hello-world

    安装成功会出现如下信息:

    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/

    为了方便使用,不用sudo就可以运行docker命令,安装好docker后再命令行输入如下命令:

    sudo usermod -aG docker $USER

     如果是xshell执行此命令,则需要断开xshell连接,重新进入

  • 相关阅读:
    创建逻辑卷LVM以及swap分区
    Linux下命令别名配置
    vim多行注释与删除
    Linux下parted分区超过2TB硬盘-分区格式化
    scp命令限速远程拷贝
    tar命令加密压缩/解密解压
    centos下dnsmasq安装与配置
    Mac OS: xcrun: error: invalid active developer path, missing xcrun
    C/C++编译器GCC:GNU Compiler Collection
    es分页查询限制的问题
  • 原文地址:https://www.cnblogs.com/zhanghaibin16/p/12272333.html
Copyright © 2011-2022 走看看