task_show_uname.sh gets permission error
vkbaba opened this issue · comments
vkbaba commented
Run:
fly -t tutorial e -c task_show_uname.yml
The log shows:
uploading task-scripts done
executing build 3 at http://localhost:8080/builds/3
initializing
running ./task-scripts/task_show_uname.sh
Backend error: Exit status: 500, message: {"Type":"","Message":"runc exec: exit status 1: exec failed: container_linux.go:349: starting container process caused \"exec: \\\"./task-scripts/task_show_uname.sh\\\": permission denied\"","Handle":"","ProcessID":"","Binary":""}
errored
SimonGurney commented
Confirmed on mine too, had to switch to:
---
platform: linux
image_resource:
type: docker-image
source: {repository: busybox}
inputs:
- name: task-scripts
run:
path: /bin/sh
args:
- ./task-scripts/task_show_uname.sh
I then had issues with some hidden encoding or line ending issue and it kept saying:
uname: unrecognized option:
BusyBox v1.33.1 () multi-call binary.
Usage: uname [-amnrspvio]
Print system information
-a Print all
-m The machine (hardware) type
-n Hostname
-r Kernel release
-s Kernel name (default)
-p Processor type
-v Kernel version
-i The hardware platform
-o OS name
Retyping out the line uname -a fixed it within the sh file.
Norman Abramovitz commented
Closing issue since #219 was merged solving this issue as well. Moved to using explicit shell execution versus implicit shell execution.