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

    1.1 安装docker

    1. 基础软件安装

      # 安装基本软件
      $ sudo apt-get update
      $ sudo apt-get install apt-transport-https ca-certificates curl git software-properties-common lrzsz -y
    2. 添加阿里的docker镜像仓库

      # 添加阿里的docker镜像仓库
      $ curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
      $ sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
      # 更新软件源
      $ sudo apt-get update
    3. 安装docker

      # 安装docker
      $ sudo apt-get install docker-ce -y
      # 查看安装的docker版本
      $ docker version
      Client:
              Version:           18.06.1-ce
              API version:       1.38
              Go version:       go1.10.3
              Git commit:       e68fc7a
              Built:             Tue Aug 21 17:24:51 2018
              OS/Arch:           linux/amd64
              Experimental:      false
        Got permission denied while trying to connect to the Docker daemon socket at
        unix:///var/run/docker.sock: Get
        http://%2Fvar%2Frun%2Fdocker.sock/v1.38/version:
        dial unix /var/run/docker.sock: connect: `permission denied`
      # 当前用户直接操作docker时, 权限不够, 需要做下面的第4不操作
    4. 将当前用户添加到docker组

      # 将用户加入该 group 内。然后退出并重新登录就生效啦。
      $ sudo gpasswd -a ${USER} docker
      # 重启docker服务
      $ systemctl restart docker
      # 当前用户切换到docker群组
      $ newgrp - docker
      $ docker version
      Client:
              Version:           18.06.1-ce
              API version:       1.38
              Go version:       go1.10.3
              Git commit:       e68fc7a
              Built:             Tue Aug 21 17:24:51 2018
              OS/Arch:           linux/amd64
              Experimental:      false

        Server:
              Engine:
              Version:          18.06.1-ce
              API version:      1.38 (minimum version 1.12)
              Go version:       go1.10.3
              Git commit:       e68fc7a
              Built:           Tue Aug 21 17:23:15 2018
              OS/Arch:         linux/amd64
              Experimental:     false
    5. 安装docker-compose

      #安装依赖工具
      $ sudo apt-get install python3-pip -y
      #安装编排工具
      $ sudo pip3 install docker-compose
      #查看版本
      $ sudo docker-compose version
  • 相关阅读:
    Collection(集合)知识点总结
    【Mysql 学习】mysql 的使用复习
    解决Address localhost:1099 is already in use
    mysql8.0中dcl语句修改密码的语法
    mysql+sqlyog 多表查询练习
    MySQL 8.0 Public Key Retrieval is not allowed 错误的解决方法
    JDBC连接Mysql 8.0.12版本的几个注意事项
    JSTL学习
    64-多个参数个数
    63-参数的使用
  • 原文地址:https://www.cnblogs.com/a208606/p/11218914.html
Copyright © 2011-2022 走看看