• Ubuntu 安装 docker 及 镜像加速


    # 访问服务器
    ssh root@47.96.159.162
    
    # apt升级
    sudo apt-get update
    # 添加相关软件包
    sudo apt-get install apt-transport-https sudo apt-get install ca-certificates sudo apt-get install curl sudo apt-get install software-properties-common # 下载软件包的合法性,需要添加软件源的 GPG 密钥 curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add - # source.list 中添加 Docker 软件源 sudo add-apt-repository \ "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/ \ $(lsb_release -cs) \ stable" # 安装 Docker CE (CE为社区版,可以理解为免费版,EE版为企业版,需要单独收费) sudo apt-get update sudo apt-get install docker-ce # 启动 Docker CE sudo systemctl enable docker sudo systemctl start docker # 建立 docker 用户组(附加) sudo groupadd docker sudo usermod -aG docker $USER # helloworld测试下 会自动下载 hello-world 镜像 docker run hello-world


     

    常用镜像有以下三个

    # 添加镜像到配置文件中  
    vi /etc/docker/daemon.json # 将以下代码粘贴到json文件中 { "registry-mirrors": [ "https://dockerhub.azk8s.cn", "https://reg-mirror.qiniu.com" ] } # 重新加载服务配置文件 重启docker服务 sudo systemctl daemon-reload sudo systemctl restart docker # 尝试下载一个nginx镜像 速度会飞快 docker pull nginx
  • 相关阅读:
    五步轻松实现对现代浏览器的兼容
    本地存储—localStorage(HTML5)
    浏览器本地存储(browser-storage)
    behavior
    CodeForces
    Codeforces 982C(dfs+思维)
    Codeforces 982C(dfs+思维)
    P3370 【模板】字符串哈希
    codeforces 985E Pencils and Boxes(dp+思维)
    codeforces 985E Pencils and Boxes(dp+思维)
  • 原文地址:https://www.cnblogs.com/fmixue/p/15775435.html
Copyright © 2020-2023  润新知