【问题标题】:docker in gitlab pipeline cant access compose file on host machinegitlab管道中的docker无法访问主机上的撰写文件
【发布时间】:2022-08-04 19:11:43
【问题描述】:

我使用以下 .gitlab-ci.yml :

stages:
    - build

docker-build:
  # Use the official docker image.
  image:
    name: docker:latest
    entrypoint: [\"\"]
  stage: build
  services:
    - docker:dind
  variables:
    DOCKER_HOST: tcp://docker:2375/
    DOCKER_DRIVER: overlay2
  script:
    - docker-compose -f compose_testfile.yaml down
  ...(and so on)

但我得到了错误:

/builds/testaccount/testproject/compose_testfile.yaml: no such file or directory

compose-file 位于安装 gitlab-runner 的机器上,如何从 docker-build 中的 .gitlab-ci.yml 访问该文件?

    标签: docker gitlab-ci


    【解决方案1】:

    您需要将 compose 配置文件添加到存储库,就像使用 gitlab 管道配置一样。

    【讨论】:

      猜你喜欢
      • 2019-10-06
      • 2021-02-11
      • 2021-09-13
      • 2018-12-10
      • 2021-12-30
      • 2018-10-23
      • 2015-01-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多