GoogleCloudPlatform / cloud-builders-community

Community-contributed images for Google Cloud Build
https://cloud.google.com/cloud-build/
Apache License 2.0
1.26k stars 858 forks source link

Helmfile image runs into line-endings issues when starting build from Windows #530

Open johnwchadwick opened 3 years ago

johnwchadwick commented 3 years ago

Affected builder image

gcr.io/cloud-builders-community/helmfile

Expected Behavior

docker run -it --rm --entrypoint /bin/bash gcr.io/insomnia-api-staging/helmfile -c "file /builder/helmfile.bash"
/builder/helmfile.bash: Bourne-Again shell script, ASCII text executable

Builds using the default entrypoint should succeed as expected.

Actual Behavior

docker run -it --rm --entrypoint /bin/bash gcr.io/insomnia-api-staging/helmfile -c "file /builder/helmfile.bash"
/builder/helmfile.bash: Bourne-Again shell script, ASCII text executable, with CRLF line terminators

Builds using the default entrypoint fail as follows:

standard_init_linux.go:228: exec user process caused: no such file or directory

Steps to Reproduce the Problem

  1. Clone GoogleCloudPlatform/cloud-builders-community on Windows
  2. cd cloud-builders-community/helmfile
  3. gcloud builds submit --config .\cloudbuild.yaml
  4. Start pipeline using resulting image
  5. Observe failure.

Additional Info

It'd be possible to fix this issue with a .gitattributes file to at least prevent autocrlf from touching bash scripts. However, as of now I don't see any such files in this repo.

This issue likely affects other images here. It'd probably be good to just use .gitattributes to entirely override autocrlf behavior.

dgduncan commented 2 years ago

This affects the Firebase image as well