4

我正在关注Stark & Wayne教程并遇到了一个问题:

管道失败

hijack: Backend error: Exit status: 500, message {"Type":"","Message": "
runc exec: exit status 1: exec failed: container_linux.go:247:
starting container process caused \"exec format error\"\n","Handle":""}

我有一项git资源和一项工作,一项任务:

- task: test
  file: resource-ci/ci/test.yml

test.yml 文件:

platform: linux

image_resource:
  type: docker-image
  source:
    repository: busybox
    tag: latest

inputs:
- name: resource-tool

run:
  path: resource-tool/scripts/deploy.sh

deploy.sh是一个简单的虚拟文件,只有一个echo命令

echo [+] Testing in the process ...

那会是什么?

4

2 回答 2

4

此错误意味着它尝试在您的脚本中调用的 shell 在运行您的任务的容器上不可用。

Busybox 不带 bash,它只带/bin/sh,检查 shebang in deploy.sh,确保它看起来像:

#!/bin/sh
# rest of script
于 2017-03-15T17:20:41.727 回答
0

当我忘记!在管道 shell 脚本的顶部添加一个时,我也遇到了这个错误:

#/bin/bash
# rest of script
于 2017-08-25T20:38:49.707 回答