我有台服务器在运行Gitlab。假设地址是https://gitlab.mydomain.com
。
现在我想要实现的是安装一个持续集成系统。由于我正在使用Gitlab,我选择Gitlab CI,因为它感觉更自然的方式。所以我去码头回购中心找到了这幅图像。
因此,我运行这个映像来创建一个容器,如下所示
docker run --restart=always -d -p 9000:9000 -e GITLAB_URLS="https://gitlab.mydomain.com" anapsix/gitlab-ci
我给它一分钟的启动,我现在可以访问CI通过URL http://gitlab.mydomain.com:9000
。到目前一切尚好。
我登录了CI,并收到这样的信息:
Now you need Runners to process your builds.
所以我回到码头中心,找到了另一幅图像。显然,为了启动这个图像,我必须进行交互。按照说明,它将创建配置文件:
mkdir -p /opt/gitlab-ci-runner
docker run --name gitlab-ci-runner -it --rm -v /opt/gitlab-ci-runner:/home/gitlab_ci_runner/data sameersbn/gitlab-ci-runner:5.0.0-1 app:setup
交互式设置将要求我提供它需要的适当数据:
Please enter the gitlab-ci coordinator URL (e.g. http://gitlab-ci.org:3000/ )
http://gitlab.mydomain.com:9000/
Please enter the gitlab-ci token for this runner:
12345678901234567890
Registering runner with registration token: 12345678901234567890, url: http://gitlab.mydomain.com:9000/.
Runner token: aaaaaabbbbbbcccccccdddddd
Runner registered successfully. Feel free to start it!
我去了http://gitlab.mydomain:9000/admin/runners
,万岁,跑步者出现在舞台上。
一切看起来都很好,但是来了一个问题,
如果我重新启动机器,由于更新或任何原因,运行程序不再存在。在运行运行程序的映像时,我可能会将--restart=always
添加到命令中,但这是有问题的,因为:
我怎样才能解决这个问题?
发布于 2014-12-02 17:07:11
我有一个方法来指出你的正确方向,但我试图让它自己,希望我们都设法使它在这里我的情况。
我正在使用coreOS + docker来完成您想要做的事情,在coreOS中,您可以在每次重新启动机器(以及gitlab和其他设备)时设置一个启动CI的服务,我的问题是让同样的安装自动化。
经过一番挖掘,我发现了这个:https://registry.hub.docker.com/u/ubergarm/gitlab-ci-runner/
在这个文档中,他们说他们可以用两种方式来做:
这意味着你可以用你的信任来自动启动CI,我已经尝试了2天了,如果你能做到的话,告诉我如何=(
https://stackoverflow.com/questions/26870508
复制相似问题