I have created an application with a simple Dockerfile.template
FROM balenalib/%%BALENA_MACHINE_NAME%%-alpine-python:3.7-build as build RUN echo "Hello" COPY idle.sh idle.sh CMD ["/bin/bash","-c",". idle.sh"]
The target device is a
fincm3 in an application with ID 1497516 named
fins-to-the-left. I try to build using:
balena build -a fins-to-the-left
and it fails
balena-test> balena build -a fins-to-the-left [Info] Creating default composition with source: /Users/ff/consulting/NSR/dev/balena-test [Info] Building for armv7hf/fincm3 [Info] Docker Desktop detected (daemon architecture: "x86_64") [Info] Docker itself will determine and enable architecture emulation if required, [Info] without balena-cli intervention and regardless of the --emulated option. [Build] Built 1 service in 0:01 [Build] main [=============> ] 66% Step 2/3: standard_init_linux.go:211: exec user process caused "no such file or directory" [Error] Build failed The command '/bin/sh -c echo "Hello"' returned a non-zero code: 1 Additional information may be available by setting a DEBUG=1 environment variable: "set DEBUG=1" on a Windows command prompt, or "export DEBUG=1" on Linux or macOS. If you need help, don't hesitate in contacting our support forums at https://forums.balena.io For CLI bug reports or feature requests, have a look at the GitHub issues or
Removing the offending
RUN command, I can build and the run the image, and then logging into the container I can see
bash-5.0# sh -c echo hello bash: /bin/sh: /bin/sh.real\nbalena-info\nrm: bad interpreter: No such file or directory bash-5.0# cat /bin/sh #!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"
/bin/sh is broken?