zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    VS2013快速安装教程
    软件工程课程的感想
    GitHub和Microsoft TFS对比有什么优势
    拼接素数
    C语言程序题
    vue中的实例方法的底层原理
    ios 安卓
    防抖
    伪数组转真数组的放法
    http和https的一种能力?
  • 原文地址:https://www.cnblogs.com/fmixue/p/15775435.html
Copyright © 2011-2022 走看看