我正尝试在 Github Actions 文件中使用 buildx 构建一个 Compose 文件,但出现了以下错误:
[104392] Failed to execute script docker-compose
Traceback (most recent call last):
File "docker-compose", line 3, in <module>
File "compose/cli/main.py", line 81, in main
File "compose/cli/main.py", line 203, in perform_command
File "compose/metrics/decorator.py", line 18, in wrapper
File "compose/cli/main.py", line 380, in build
File "compose/project.py", line 519, in build
File "compose/project.py", line 501, in build_service
File "compose/service.py", line 1133, in build
File "compose/service.py", line 1950, in build
IndexError: list index out of range
Error: Process completed with exit code 255.
在错误出现之前,在构建堆栈步骤中完成了所有Dockerfile步骤,之后应该开始导出镜像。
当我尝试在我部署在一个节点下的github runner中运行相同的命令时,没有任何错误。
当我从github actions yaml文件中删除设置buildx步骤时,错误就不会出现。
这是integration.yaml(github actions):
name: Continuous Integration
on:
pull_request:
branches: '*'
jobs:
integration:
name: Setup Docker
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Buildx
uses: docker/setup-buildx-action@v1
with:
install: true
driver-opts: >-
image=moby/buildkit:master
- name: Cache main image layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Prepare environment
run: |
cp .npmrc.example .npmrc
cp .env.example .env
- name: Build stack
run: |
DOCKER_BUILDKIT=1 ./devops ci build --no-cache --build-arg USER_UID=$(id -u) --build-arg USER_GID=$(id -g) app
DevOps脚本基本上执行以下命令:
docker-compose -f docker-compose.yml -f .docker/overrides/docker-compose.ci.yml build --build-arg USER_UID=$(id -u) --build-arg USER_GID=$(id -g) app
这是否与我在docker-compose文件中定义的某些标签有关?非常感谢任何答案,因为我没有找到其他相关问题。谢谢 :)