Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为中国大陆的Docker初学者给出换源提醒 #13

Closed
LuminousXLB opened this issue Dec 6, 2020 · 5 comments · Fixed by #16
Closed

为中国大陆的Docker初学者给出换源提醒 #13

LuminousXLB opened this issue Dec 6, 2020 · 5 comments · Fixed by #16

Comments

@LuminousXLB
Copy link
Collaborator

由于众所周知的网络环境,中国大陆从 Docker 的官方 Registry 下载镜像非常慢(几乎可以说是不可用的状态)。
如果本实验假设学生没有Docker的使用经验的话,建议特别提醒他们设置Docker的镜像源。

@kevin-w-du
Copy link
Member

这是个大问题。如何换Docker的镜像源,这点我也不清楚。国内有镜像码?

@LuminousXLB
Copy link
Collaborator Author

LuminousXLB commented Dec 6, 2020

修改或新增 /etc/docker/daemon.json 文件,内容如下

{
  "registry-mirrors": [
    "https://hub-mirror.c.163.com",
    "https://mirror.baidubce.com",
    "https://docker.mirrors.sjtug.sjtu.edu.cn"
  ]
}

执行命令以启用镜像

$ sudo systemctl daemon-reload
$ sudo systemctl restart docker
$ sudo docker info

可以在末尾的 Registry Mirrors 中看到已经启用的镜像源。

数组内可以设置为不同的镜像源。目前设置的三个镜像源来自网易、百度和上海交大。
另外还有阿里云的容器镜像服务,但是需要阿里云的账号才能访问。

应该网络上还有其他的镜像,我目前使用的是这四个

@kevin-w-du
Copy link
Member

非常感谢。我会写一个文档(在英文版里),因为别的国家的学生可能也有同样的问题。麻烦你在中文版里加一个文件(放在common-file/container 里面,然后在每个用到container的实验里input这个文件(在环境设置section里)。谢谢。

@kevin-w-du
Copy link
Member

我在docker的manual里加了一个文件,链接到了common problem章节。我就不打算在tex文件里加了。这个问题可能是大陆特有的,所以在中文翻译里还是提一下,然后让学生去看这个文档。所以不需要把详细的instruction放到tex文件里。

kevin-w-du added a commit that referenced this issue Dec 7, 2020
@kevin-w-du
Copy link
Member

我今天在华为云上测试SEED实验,的确发现国内几乎没法用官方的Docker Hub。按照你的方法试了一下,问题就解决了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants