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 build 使用默认apt源时,在国内编译很慢,有时会导致出错 #919

Closed
wen-bo-yang opened this issue Dec 16, 2016 · 6 comments · Fixed by #927
Closed
Assignees

Comments

@wen-bo-yang
Copy link
Contributor

按照https://github.com/PaddlePaddle/Paddle/blob/develop/doc/getstarted/build_and_install/docker_install_en.rst
进行使用源码中提供的dockersfile进行编译时,在apt-get更新软件包时会很慢,有时会出现build失败的情况。
这块是否需要增加对apt-get源进行用户自定义的支持?

@dayhaha
Copy link
Contributor

dayhaha commented Dec 16, 2016

我build的时候也是遇到了源的问题,build失败。
2016-12-16 1 08 45
将源改成163的源才通过了build
RUN sed -i 's#http://archive.ubuntu.com#http://mirrors.163.com#g' /etc/apt/sources.list

@wen-bo-yang
Copy link
Contributor Author

是否可以在build时传递--build-arg参数,并且在dockerfile中apt-get之前判断这个参数是否开启,来进行更改apt源的方式(针对国内apt源的修改)。
具体如下
build docker images:
docker build --build-arg CHINA_APT_SOURCE=ON -t p:test -f Dockerfile .
Dockerfile:
image

即在RUN apt-get update && apt-get install xxx 之前进行参数判断并更改container的/etc/apt/sources.list

@reyoung reyoung self-assigned this Dec 16, 2016
@reyoung
Copy link
Collaborator

reyoung commented Dec 16, 2016

交PR吧。。

不过感觉起来,参数叫做APT_MIRROR
然后使用起来是

docker build --build-arg APT_MIRROR="http://mirrors.163.com"

这样。

@wen-bo-yang
Copy link
Contributor Author

收到

@reyoung
Copy link
Collaborator

reyoung commented Dec 16, 2016

APT_MIRROR => UBUNTU_MIRROR 吧。

@wen-bo-yang
Copy link
Contributor Author

已经提交PR #927
PR中修改了dockerfile和英文文档

zhhsplendid pushed a commit to zhhsplendid/Paddle that referenced this issue Sep 25, 2019
* update memory_optimize.rst, test=develop

* follow comment, fix typo, test=develop
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.

3 participants