小哥之哥 小哥之哥
首页
    • Prometheus
    • Kubertenes
    • Docker
    • MySQL
  • Go
  • Python
  • Vue
  • Jenkins
  • ELK
  • LDAP
  • 随笔
  • 最佳实践
  • 博客搭建
  • 问题杂谈
关于
友链
  • 分类
  • 标签
  • 归档
GitHub (opens new window)

小哥之哥

运维扫地僧
首页
    • Prometheus
    • Kubertenes
    • Docker
    • MySQL
  • Go
  • Python
  • Vue
  • Jenkins
  • ELK
  • LDAP
  • 随笔
  • 最佳实践
  • 博客搭建
  • 问题杂谈
关于
友链
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
  • Kubertenes

  • Prometheus

  • Docker

  • 数据库

  • 运维利器

    • 运维技巧
    • 运维
    • 运维利器
    tchua
    2023-03-16
    目录

    运维技巧

    # 日常工作利器

    记录日常工作中小技巧,旨在提高运维工作效率


    # 一、GitHub加速

    git clone https://ghproxy.com/${githu项目地址}

    例如:

    git clone https://ghproxy.com/https://github.com/prometheus-operator/kube-prometheus.git

    # 二、Docker镜像加速

    • 第一种: 使用代理模式

    比如下载镜像nginx,代理地址:m.daocloud.io,更多使用方式: https://github.com/DaoCloud/public-image-mirror

    # 直接pull 可能会失败
    docker pull nginx:latest
    # 使用代理模式
    docker pull m.daocloud.io/docker.io/nginx:latest
    # tag 
    # ## 使用代理模式 会导致镜像tag也会按照代理模式 因此为了方便可以对镜像重新命名
    docker tag m.daocloud.io/docker.io/nginx:latest docker.io/nginx:latest
    
    1
    2
    3
    4
    5
    6
    7
    • 第二中: 修改/etc/docker/daemon.json模式

    国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务,需要注意的是,需要保证代理地址可用性,具体查看:https://gist.github.com/y0ngb1n/7e8f16af3242c7815e7ca2f0833d3ea6

    sudo mkdir -p /etc/docker
    sudo tee /etc/docker/daemon.json <<-'EOF'
    {
        "registry-mirrors": [
            "https://docker.m.daocloud.io",
            "https://dockerproxy.com",
            "https://docker.mirrors.ustc.edu.cn",
            "https://docker.nju.edu.cn"
        ]
    }
    EOF
    sudo systemctl daemon-reload
    sudo systemctl restart docker
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    编辑 (opens new window)
    #运维
    上次更新: 2023/06/26, 15:32:56
    MongoDB部署

    ← MongoDB部署

    最近更新
    01
    cert-manager自动签发Lets Encrypt
    09-05
    02
    Docker构建多架构镜像
    08-02
    03
    Prometheus数据迁移至VMstorage
    08-01
    更多文章>
    Theme by Vdoing | Copyright © 2023-2024 |豫ICP备2021026650号
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式