如果我在使用绑定挂载的 GitHub Actions 中运行 Docker Compose 命令,它会说源目录不存在。这是错误。
Cannot create container for service chat: invalid mount config for type "bind": bind source path does not exist: /__w/omni-chat/omni-chat
我认为问题在于根目录被错误地传递给 GitHub Actions。我将绝对路径指定为传统的.
,但我不知道 GitHub Actions 对此有何警告。
这是我的工作流程的简化版本。
on: push
jobs:
test-server:
runs-on: ubuntu-latest
container: docker/compose
steps:
- uses: actions/checkout@v2
- run: docker-compose run --rm chat gradle test
这是我的 Docker Compose 文件的简化版本。
version: '3.7'
services:
chat:
image: gradle:6.3-jdk8
command: bash
volumes:
- type: bind
source: .
target: /home/gradle
- type: volume
source: gradle-cache
target: /home/gradle/.gradle
volumes:
gradle-cache:
如果您需要完整的详细信息,这里是确切的运行。
事实证明,您应该使用预装的 Docker Compose 安装。因此,简单地删除指定的container
将允许绑定安装工作,因为它不再是 Docker-in-Docker 场景。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句