Docker Gitlab.com runners:如何从外部repos安装和运行软件?

Docker Gitlab.com runners:如何从外部repos安装和运行软件?,docker,gitlab-ci-runner,Docker,Gitlab Ci Runner,我对Gitlab.com的CI和docker都很陌生 我有一个简单的python pelican静态博客,它使用一个简单的.gitlab-ci.yml构建 所以我看到它指定了一个python docker映像,使用pip安装各种python脚本,然后在该映像中运行pelican all 现在我的问题是,我想运行一个我自己版本的鹈鹕。我修改了requirements.txt文件以查找我自己的鹈鹕分支,但失败了 beautifulsoup4 markdown smartypants typogrif

我对Gitlab.com的CI和docker都很陌生

我有一个简单的python pelican静态博客,它使用一个简单的.gitlab-ci.yml构建

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

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

beautifulsoup4
markdown
smartypants
typogrify
git+https://github.com/jerryasher/pelican.git@hidden-cats
pelican-fontawesome
pelican-gist
pelican-jsfiddle
pelican-neighbors
现在,当它构建时,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,但也失败了,因为。。。没有吉特

我正在使用python:2.7-alpine的docker图像似乎也没有合适的格式

我是否需要构建自己的docker映像,其中包含git和python以及我需要的任何其他内容,或者是否有某种常见的方法让Gitlab.com运行程序从git repo或某些典型的linux包存储库中引入外部程序


如果我不能做到这一点,那么这是跑步者的错,还是码头工人形象的错

如果需要,您可以安装git和任何其他软件包。您自己的图像将更快,但它不是必需的

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

谢谢,现在我正在使用我自己的docker图像,这本身就是一次有趣的冒险。我将使用apk而不是apt get重试此操作。我想我更喜欢使用正式的docker映像,然后根据需要在yml中修改它们。@Jerry您使用的映像是基于alpine linux的,因此它没有apt或bash或任何其他东西。python:2.7映像基于Debian,因此它确实提供了您更熟悉的工具。
pages:
  script:
    - apk --update add git openssh
    - pip install -r requirements.txt
    ...