目录

  • 1. docker 国内镜像与 docker hub 镜像, docker-compose
    • 1.1. 通过国内镜像安装 docker
      • 1.1.1. Debian
      • 1.1.2. RHEL
    • 1.2. 官方安装
      • 1.2.1. 安装
      • 1.2.2. 设置: 非 root 用户直接使用
      • 1.2.3. 设置: 服务开机启动
    • 1.3. docker hub 镜像
      • 1.3.1. Docker Hub 源使用帮助
    • 1.4. docker-compose

1. docker 国内镜像与 docker hub 镜像, docker-compose

1.1. 通过国内镜像安装 docker

国内安装指南: https://mirrors.tuna.tsinghua.edu.cn/help/docker-ce/

1.1.1. Debian

# 如果你过去安装过 docker, 先删掉:
sudo apt-get remove docker docker-engine docker.io# 首先安装依赖:
sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common# 信任 Docker 的 GPG 公钥:
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -# 对于 amd64 架构的计算机, 添加软件仓库:
sudo add-apt-repository \"deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian \$(lsb_release -cs) \stable"# 如果你是树莓派或其它 ARM 架构计算机, 请运行:
echo "deb [arch=armhf] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian \$(lsb_release -cs) stable" | \sudo tee /etc/apt/sources.list.d/docker.list# 最后安装
sudo apt-get update
sudo apt-get install docker-ce

1.1.2. RHEL

# 如果你之前安装过 docker, 请先删掉
sudo yum remove docker docker-common docker-selinux docker-engine# 安装一些依赖
sudo yum install -y yum-utils device-mapper-persistent-data lvm2# 根据你的发行版下载 repo 文件: CentOS/RHEL
wget -O /etc/yum.repos.d/docker-ce.repo https://download.docker.com/linux/centos/docker-ce.repo# 把软件仓库地址替换为 TUNA:
sudo sed -i 's+download.docker.com+mirrors.tuna.tsinghua.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo# 最后安装:
sudo yum makecache fast
sudo yum install docker-ce

1.2. 官方安装

Install: Install Docker Engine on Ubuntu

More: Linux post-installation steps for Docker Engine

1.2.1. 安装

Ubuntu:

# Uninstall any such older versions before attempting to install a new version
sudo apt-get remove docker docker-engine docker.io containerd runc# Update the apt package index and install packages to allow apt to use a repository over HTTPS
sudo apt-get update
sudo apt-get install \ca-certificates \curl \gnupg \lsb-release# Add Docker’s official GPG key
sudo mkdir -m 0755 -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg# Use the following command to set up the repository
echo \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null# Update the apt package index
sudo apt-get update# Install Docker Engine, containerd, and Docker Compose.
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin# Verify that the Docker Engine installation is successful by running the hello-world image:
sudo docker run hello-world

1.2.2. 设置: 非 root 用户直接使用

sudo groupadd docker
sudo usermod -aG docker $USER
docker run hello-world

1.2.3. 设置: 服务开机启动

To automatically start Docker and containerd on boot for other Linux distributions using systemd, run the following commands:

sudo systemctl enable docker.service
sudo systemctl enable containerd.service

To stop this behavior, use disable instead.

sudo systemctl disable docker.service
sudo systemctl disable containerd.service

1.3. docker hub 镜像

访问连接: https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors

针对 Docker 客户端版本大于 1.10.0 的用户

您可以通过修改 daemon 配置文件 /etc/docker/daemon.json 来使用加速器

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{"registry-mirrors": ["https://xxx.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
{"registry-mirrors": ["http://hub-mirror.c.163.com","https://registry.cn-hangzhou.aliyuncs.com","https://xxx.mirror.aliyuncs.com","https://docker.mirrors.ustc.edu.cn"]
}

1.3.1. Docker Hub 源使用帮助

  • 对于使用 systemd 的系统 (Ubuntu 16.04+、Debian 8+、CentOS 7), 在配置文件 /etc/docker/daemon.json 中加入(如果没有则新建一个):
{"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn/"]
}

重新启动 dockerd:

sudo systemctl restart docker
  • 对于使用 upstart 的系统 (Ubuntu 14.04、Debian 7 Wheezy), 在配置文件 /etc/default/docker 中的 DOCKER_OPTS 中配置 Hub 地址:

在配置文件 /etc/default/docker 中的 DOCKER_OPTS 中配置 Hub 地址:

DOCKER_OPTS="--registry-mirror=https://docker.mirrors.ustc.edu.cn/"

重新启动服务:

sudo service docker restart

检查 Docker Hub 是否生效

在命令行执行 docker info, 如果从结果中看到了如下内容, 说明配置成功。

Registry Mirrors:https://docker.mirrors.ustc.edu.cn/

1.4. docker-compose

官方: https://docs.docker.com/compose/install/

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version

docker 国内镜像与 docker hub 镜像, docker-compose相关推荐

  1. docker公共存储库_Docker Hub镜像公共仓库使用

    Docker Hub镜像公共仓库使用 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.登录Docker Hub 1>.访问Docker Hub官网(https://hub. ...

  2. Docker Hub 镜像加速器

    感谢您的阅读,本文由 杨斌的博客 版权所有. 如若转载,请注明出处:杨斌的博客(y0ngb1n.github.io/a/docker-re-) 本文首发于 GitHub Gist:gist.githu ...

  3. Java Spring Boot 2.0 实战之制作Docker镜像并推送到Docker Hub和阿里云仓库

    内容摘要:大规模集群快速部署Java应用,需要制作Docker镜像,本次课程详细介绍如何制作Java程序的Docker镜像文件,深入解析DockerFile核心参数,以及实践演练把我们制作的Docke ...

  4. Docker国内镜像地址和下载安装

    [引言]因为国内docker全面被(GFW)墙,完全无法安装或是下载镜像或者下载速度慢.所以就像无数的先辈们一样,我们有了国内的镜像源.不过这次有点不同,这次叫做加速器: https://dashbo ...

  5. 使用Docker国内镜像源

    操作环境:CentOS Linux release 7.6.1810 (Core) Docker 官方维护了一个公共仓库 Docker Hub,目前已有15,000+ 的镜像. 一般情况下,通过 do ...

  6. centos7代理使用docker国内镜像

    centos7的docker安装只要使用 yum install docker就可以了. 之后就是拉取镜像了,国内连不上docker hub.所以使用阿里的镜像. 关于加速器的地址,你只需要登录容器H ...

  7. docker国内镜像拉取和镜像加速registry-mirrors配置修改

    由于国内访问直接访问docker hub网速比较慢,拉取镜像的时间就会比较长.一般我们会使用镜像加速或者直接从国内的一些平台镜像仓库上拉取.  我比较常用的是网易的镜像中心和daocloud镜像市场. ...

  8. 部署企业自己的Docker Hub镜像加速器

    背景 国内从 Docker Hub 拉取镜像有时会遇到困难,一般是网络比较慢,需要很长时间,极有可能连接断裂,拉不到镜像.此时,可以配置镜像加速器.国内很多云服务商都提供了国内加速器服务,例如阿里云. ...

  9. docker公共存储库_Docker Hub公共镜像仓库的使用

    Docker Hub 目前 Docker 官方维护了一个公共仓库 Docker Hub,其中已经包括了数量超过 15,000 的镜像.大部分需求都可以通过在 Docker Hub 中直接下载镜像来实现 ...

最新文章

  1. Linux 环境 搭建Git 服务器,并且修改SSH端口使用
  2. 国内ntp服务器ip地址
  3. NetworkOnMainThreadException异常
  4. pytorch笔记:torch.nn.Threshold
  5. linux使用nginx负载udp
  6. 2.9.JavaScript--内置对象
  7. 英语笔记:写作:Free admissionsto museums
  8. Android把数组从大到小排列,Android SparseArray 排序
  9. 还没买到票?快试试这个Python开源工具,支持多任务抢票
  10. SAE J1939协议(二)
  11. 近几十年基础科学的停滞影响研究
  12. 【VMware】Assuming drive cache: write through
  13. windows10自动更新后,设备管理器蓝牙消失“未知USB设备”
  14. 【愚公系列】2022年11月 uniapp专题-优购电商-个人中心页面
  15. [线性控制理论]关于Laplace变换中求导运算的结果推导
  16. some resource favor
  17. c语言累乘法,C语言基本算法
  18. javaweb+themeleaf+Tomcat学习——org.thymeleaf.exceptions.TemplateProcessingException
  19. partition X does not end on cylinder boundary
  20. 一名普通Java程序员的2022的总结和2023的展望

热门文章

  1. 2014新增更多功能的棋牌游戏开发商
  2. 通过jhat分析内存泄漏
  3. sql server 分组小计和总计
  4. 信息化孤岛探讨及解决思路(一)
  5. 视图-叠印预览_使用预览视图显示摄像机预览
  6. 软件测试找不到工作怎么办
  7. 如果得了肾囊肿会有什么症状?
  8. 全国最大规模主动式公交优先系统落地长沙,希迪智驾创新刚需应用
  9. 【蓝桥杯真题】幸运数字的解决方法
  10. TechBullion:USDD 或将成为全新避险资产