Gitlab.com跑步者:我如何从外部回购站安装和运行软件?

我对Gitlab.com的CI和Docker相当陌生。

我有一个简单的Python鹈鹕静态博客,build立一个简单的.gitlab-ci.yml

 image: python:2.7-alpine pages: script: - pip install -r requirements.txt - pelican -s publishconf.py artifacts: paths: - public 

所以我看到它指定了一个python docker镜像,使用pip来安装各种python脚本,然后在这个镜像中运行pelican。

现在我的问题是,我想运行我自己的鹈鹕版本。 我修改我的requirements.txt文件来寻找我自己的鹈鹕分支,但是失败了

 beautifulsoup4 markdown smartypants typogrify git+https://github.com/jerryasher/pelican.git@hidden-cats pelican-fontawesome pelican-gist pelican-jsfiddle pelican-neighbors 

现在,当它build立时,Gitlab的Runner告诉我:

 Running with gitlab-ci-multi-runner 1.9.0 (82714ae) Using Docker executor with image python:2.7-alpine ... Pulling docker image python:2.7-alpine ... Running on runner-e11ae361-project-1654117-concurrent-0 via runner-e11ae361-machine-1484613050-ce975c76-digital-ocean-4gb... Cloning repository... Cloning into '/builds/jerrya/ashercodes'... Checking out 532f8b38 as master... $ pip install -r requirements.txt Collecting git+https://github.com/jerryasher/pelican.git@hidden-cats (from -r requirements.txt (line 5)) Cloning https://github.com/jerryasher/pelican.git (to hidden-cats) to /tmp/pip-72xxqt-build Error [Errno 2] No such file or directory while executing command git clone -q https://github.com/jerryasher/pelican.git /tmp/pip-72xxqt-build Cannot find command 'git' ERROR: Build failed: exit code 1 

好的,

Git似乎并不存在。 事实上,在上述尝试之前,我已经向.gitlab-ci.yml脚本添加了一行(使用git在本地克隆该repo),并且也失败了,因为没有git。

(我正在使用python:2.7-alpine的docker映像python:2.7-alpine也似乎没有apt-get 。)

我是否需要构build自己的docker映像,其中包含gitpython以及其他任何我需要的东西,或者有一些“常用”方式让Gitlab.com运行器从外部程序中获取git repo或一些典型的linux包库?

如果我不能这样做,在这种情况下是跑步者的错,还是docker形象的错?

如果你需要的话,你可以安装git(和其他软件包)。 你自己的形象会更快,但不是必需的。

 pages: script: - apk --update add git openssh - pip install -r requirements.txt ...