-1

我正在关注这个:https : //bobbybouwmann.nl/blog/dependabot-on-gitlab,试图让 Dependabot 与 gitlab 一起工作。我收到以下错误?

Using docker image sha256:bc6c0ffef6650bcfbb0afd5a07b813b5ccf1d00ecddccadb85123c6ee57a7995 for docker with digest docker@sha256:63107bd6ce718f130bb2668704239467b74f034c446f9e9c4ae1ffa5ddf4e3dd ...
$ docker build -t "dependabot/dependabot-script" -f Dockerfile .
error during connect: Post "http://docker:2375/v1.24/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=dependabot%2Fdependabot-script&target=&ulimits=null&version=1": dial tcp: lookup docker on 172.31.0.2:53: no such host

于是查了一下,指定的docker镜像不存在:https ://hub.docker.com/u/dependabot

但是,如果我使用不同的、公开可用的图像,我会得到:

Executing "step_script" stage of the job script
00:03
Using docker image sha256:ed97757f85d791b7e0a967622f0d671b810d1ad45aef30d5314dcaef94e7c457 for sethjones/dependabot-script with digest sethjones/dependabot-script@sha256:209a0952bfeb845f67f2eeb9a647c25e058bbae1b9b0e343d7891884840f17e0 ...
/usr/local/lib/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require': cannot load such file -- dependabot/file_fetchers (LoadError)
    from /usr/local/lib/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:85:in `require'
    from ./generic-update-script.rb:4:in `<main>'
Cleaning up file based variables
00:01
ERROR: Job failed: exit code 1
4

1 回答 1

1

我建议您查看Dependabot GitLab 存储库。他们提供了一个持续更新的 CI/CD 模板,因此您不必编写自己的作业,您可以使用以下方法包含他们的模板:

include:
  - project: 'dependabot-gitlab/dependabot-standalone'
    file: '.gitlab-ci.yml'

他们还在其页面上提供了有关如何将其配置为自动创建 MR 的说明。

于 2021-10-07T01:13:42.680 回答