【问题标题】:How to run a container without a shell in GitLab CI job如何在 GitLab CI 作业中运行没有 shell 的容器
【发布时间】:2020-04-04 12:05:29
【问题描述】:

我想在我的管道中运行conform 来检查提交消息,但是container image 缺少外壳,并且具有入口点/conform 和参数enforce。我的.gitlab-ci.yml 应该是这样的:

conform:
  image: docker.io/autonomy/conform:latest

没有脚本部分,但据我所知,这在 GitLab 中是不允许的。

编辑

这里有一个 GitLab issue 开放。

【问题讨论】:

    标签: docker continuous-integration gitlab gitlab-ci


    【解决方案1】:

    您始终可以将 conform 安装为 CI 的一部分:

    conformJob:
      image: golang
      script:
        - go get github.com/talos-systems/conform
        - conform enforce
    

    【讨论】:

    • 谢谢,这就是我最终所做的。
    • 如果它解决了你的问题,那么你可以接受答案:)
    猜你喜欢
    • 2018-06-06
    • 2019-10-04
    • 2021-03-08
    • 2016-08-05
    • 1970-01-01
    • 2022-08-20
    • 1970-01-01
    • 2021-11-17
    • 1970-01-01
    相关资源
    最近更新 更多