温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

快速国内代码Repo和Docker镜像的拉取怎么启动

发布时间:2021-12-13 13:46:08 来源:亿速云 阅读:277 作者:iii 栏目:大数据

这篇文章主要介绍“快速国内代码Repo和Docker镜像的拉取怎么启动”,在日常操作中,相信很多人在快速国内代码Repo和Docker镜像的拉取怎么启动问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”快速国内代码Repo和Docker镜像的拉取怎么启动”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

Apollo的主站代码Repo是在Github上,镜像Repo是在DockerHub上,拉取时间长也不稳定。

国内Repo快速拉取方式

首先,在Github Apollo的Quick Start中就有说明中国的快速代码拉取。

国内放在了Gitee上。

git clone https://gitee.com/ApolloAuto/apollo.git
git remote set-url origin git@github.com:YOUR_GITHUB_USERNAME/apollo.git
# Using SSH
git remote add upstream git@github.com:ApolloAuto/apollo.git
git remote -v
git pull --rebase upstream master

第一步: 浏览器打开如下两个网址,找到对应 IP 地址: http://github.com.ipaddress.com/ http://github.global.ssl.fastly.net.ipaddress.com/

第二步: 编辑 hosts 文件 sudo vim /etc/hosts 加入如下两行:

140.82.xx.xxx github.com 199.232.yy.yyy github.global.ssl.fastly.net

第三步:更新 DNS 缓存(仅限 Mac 用户) Linux 用户请忽略此步骤。

sudo dscacheutil -flushcache

国内镜像的快速拉取启动方式

在运行dev_start.sh时有命令行加速选项:

dev_start.sh --help
OPTIONS:
    -h, --help             Display this help and exit.
    -f, --fast             Fast mode without pulling all map volumes.
    -g, --geo <us|cn|none> Pull docker image from geolocation specific registry mirror.
    -l, --local            Use local docker image.
    -t, --tag <TAG>        Specify docker image with tag <TAG> to start.
    -d, --dist             Specify Apollo distribution(stable/testing)
    --shm-size <bytes>     Size of /dev/shm . Passed directly to "docker run"
    -y                     Agree to Apollo License Agreement non-interactively.
    stop                   Stop all running Apollo containers.

是这个-g cn的选项可以加速从国内的镜像站,而非dockerhub拉取镜像。

dev_start.sh -g cn

现在启动apollo足够爽了。

到此,关于“快速国内代码Repo和Docker镜像的拉取怎么启动”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI