Bruce Blog Bruce Blog
首页
  • CentOS
  • Ubuntu-Debian
  • 系统网络
  • 系统辅助工具
  • MySQL
  • Redis
  • Mongodb
  • Docker基础
  • Container基础
  • Kubernetes

    • Kubernetes基础
    • Kubernetes辅助
  • Container-Network
  • Jenkins
  • Gitlab
  • ArgoCD
  • Ansible
  • Terraform
  • AWS
  • MQ
  • NGINX
  • JumpServer
  • 基础
  • 函数模块
  • 框架
  • 基础

    • Golang环境
    • 语法
    • 数据类型与运算符
    • 分支语句
    • 循环语句
    • 数组
    • 切片
    • Map
    • String
    • 函数
    • 包的管理
    • 指针
    • 结构体
    • Go语言中的OOP
    • 方法和接口
    • 错误处理
  • Go进阶

    • Go进阶
  • Go框架

    • Go框架
  • Golang辅助

    • Golang辅助
  • CSS
  • HTML
  • JavaScript
  • 前端辅助
  • 常用命令
  • 性能监控工具
  • Windows下Docker使用
  • 日常学习
  • 其他导航

Bruce Tao

运维界的该溜子
首页
  • CentOS
  • Ubuntu-Debian
  • 系统网络
  • 系统辅助工具
  • MySQL
  • Redis
  • Mongodb
  • Docker基础
  • Container基础
  • Kubernetes

    • Kubernetes基础
    • Kubernetes辅助
  • Container-Network
  • Jenkins
  • Gitlab
  • ArgoCD
  • Ansible
  • Terraform
  • AWS
  • MQ
  • NGINX
  • JumpServer
  • 基础
  • 函数模块
  • 框架
  • 基础

    • Golang环境
    • 语法
    • 数据类型与运算符
    • 分支语句
    • 循环语句
    • 数组
    • 切片
    • Map
    • String
    • 函数
    • 包的管理
    • 指针
    • 结构体
    • Go语言中的OOP
    • 方法和接口
    • 错误处理
  • Go进阶

    • Go进阶
  • Go框架

    • Go框架
  • Golang辅助

    • Golang辅助
  • CSS
  • HTML
  • JavaScript
  • 前端辅助
  • 常用命令
  • 性能监控工具
  • Windows下Docker使用
  • 日常学习
  • 其他导航
  • CentOS

  • Ubuntu-Debian

    • 系统命令
    • Ubuntu

      • Ubuntu20.04 系统设置
      • ubuntu22.04 LTS配置root登录ssh root登录
      • ubuntu22.04 LTS安装docker-ce
        • Ubuntu 安装MySQL(国内镜像源)
        • Win10远程桌面连接Ubuntu 20.04
    • 系统网络

    • 系统辅助工具

    • Linux
    • Ubuntu-Debian
    • Ubuntu
    Bruce
    2022-09-11
    目录

    ubuntu22.04 LTS安装docker-ce

    # 一、安装docker

    # 卸载已经安装的软件
    $ sudo apt-get remove docker docker-engine docker.io containerd runc
    	
    # 使用包管理器安装
    $ sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
    	
    # 添加Docker官方GPG密钥:
    $ 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"
    
    # 安装Docker CE:
    $ sudo apt-get install docker-ce docker-ce-cli containerd.io -y
    
    # 添加配置文件
    $ mkdir -pv /etc/docker
    
    $ cat > /etc/docker/daemon.json <<EOF 
    {
      "exec-opts": ["native.cgroupdriver=systemd"],
      "log-driver": "json-file",
      "log-opts": {
        "max-size": "100m"
      },
      "storage-driver": "overlay2",
      "live-restore": true
    }
    EOF
    
    
    # 启动docker服务
    $ systemctl start docker
    $ systectl enable docker
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37

    ​

    # 二、docker用户配置

    $ sudo useradd docker 
    $ sudo groupadd docker
    $ sudo usermod -aG docker ubuntu
    
    1
    2
    3

    ​ ​ ​ ​

    # 三、docker-compose安装

    注意: 因为最近版本的docker-compose已经不再使用python开发,改用go来开发了,所以不能使用pip来进行安装了;这里是直接下载二进制命令文件进行安装

    # 下载docker-compose二进制文件
    $ curl -SL https://github.com/docker/compose/releases/download/v2.10.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
    $ chmod +x /usr/local/bin/docker-compose
    $ ln -sfv /usr/local/bin/docker-compose /usr/bin
    $  docker-compose version
    Docker Compose version v2.10.0
    
    1
    2
    3
    4
    5
    6
    上次更新: 2024/04/09, 16:48:42
    ubuntu22.04 LTS配置root登录ssh root登录
    Ubuntu 安装MySQL(国内镜像源)

    ← ubuntu22.04 LTS配置root登录ssh root登录 Ubuntu 安装MySQL(国内镜像源)→

    最近更新
    01
    AWS NAT-NetWork-Firwalld配置(一)
    04-09
    02
    AWS NAT-NetWork-Firwalld配置(二)
    04-09
    03
    kubernetes部署minio对象存储
    01-18
    更多文章>
    Theme by Vdoing | Copyright © 2019-2024 Bruce Tao Blog Space | MIT License
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式