簡體   English   中英

gitlab 管道中的 docker 無法訪問主機上的撰寫文件

[英]docker in gitlab pipeline cant access compose file on host machine

我使用以下.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:沒有這樣的文件或目錄

compose-file 位於安裝 gitlab-runner 的機器上,如何從 docker-build 中的.gitlab-ci.yml 訪問該文件?

您需要將 compose 配置文件添加到存儲庫,就像使用 gitlab 管道配置一樣。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM