Emulated multi-container build fails


#1

Note: This is a copy from https://github.com/balena-io/balena-cli/issues/1092, as there doesn’t seem to be much response

  • Cli version: 9.12.0
  • Standalone install: no
  • Node version: v8.11.1
  • Npm version: 5.6.0
  • Operating system and architecture: Fedora 64bit
    I’m trying to build an arm multi-container setup using docker-compose.yml on a linux x64 host running balena-cli 9.12.0. The docker-compose file references three services by using the build: ./a directive. I can build the individual folders just fine running balena build --deviceType raspberrypi3 --arch armv7hf --emulated --logs.
    However, when running the exact same command in the root folder (where the docker-compose file resides), I get the following error message:
DEBUG=1 balena build --deviceType raspberrypi3 --arch armv7hf --logs --source . --emulated
[Debug]   Parsing input...
[Debug]   Loading project...
[Debug]   Resolving project...
[Info]    Compose file detected
[Debug]   Creating project...
[Info]    Building for armv7hf/raspberrypi3
[Build]   Building services...
[Build]   cec Preparing...
[Info]    Emulation is enabled
[Debug]   Prepared tasks; building...
[Build]   Built 1 service in 0 seconds
[Error]   Build failed
Error: COPY failed: stat /var/lib/docker/tmp/docker-builder408262108/.balena/qemu-execve: no such file or directory
    at Stream.<anonymous> (/home/ow/.nvm/versions/node/v8.11.1/lib/node_modules/balena-cli/node_modules/resin-docker-build/build/builder.js:89:33)
    at Stream.stream.write (/home/ow/.nvm/versions/node/v8.11.1/lib/node_modules/balena-cli/node_modules/through/index.js:26:11)
    at Stream.ondata (internal/streams/legacy.js:16:26)
    at emitOne (events.js:116:13)
    at Stream.emit (events.js:211:7)
    at drain (/home/ow/.nvm/versions/node/v8.11.1/lib/node_modules/balena-cli/node_modules/through/index.js:36:16)
    at Stream.stream.queue.stream.push (/home/ow/.nvm/versions/node/v8.11.1/lib/node_modules/balena-cli/node_modules/through/index.js:45:5)
    at Parser.parser.onToken (/home/ow/.nvm/versions/node/v8.11.1/lib/node_modules/balena-cli/node_modules/JSONStream/index.js:132:18)
    at Parser.proto.write (/home/ow/.nvm/versions/node/v8.11.1/lib/node_modules/balena-cli/node_modules/jsonparse/jsonparse.js:135:34)
    at Stream.<anonymous> (/home/ow/.nvm/versions/node/v8.11.1/lib/node_modules/balena-cli/node_modules/JSONStream/index.js:23:12)
    at Stream.stream.write (/home/ow/.nvm/versions/node/v8.11.1/lib/node_modules/balena-cli/node_modules/through/index.js:26:11)
    at IncomingMessage.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at IncomingMessage.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at IncomingMessage.Readable.push (_stream_readable.js:208:10)
    at HTTPParser.parserOnBody (_http_common.js:139:22)
    at Socket.socketOnData (_http_client.js:440:20)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at Pipe.onread (net.js:607:20)

If you need help, don't hesitate in contacting us at:

  GitHub: https://github.com/balena-io/balena-cli/issues/new
  Forums: https://forums.balena.io

FWIW, I copied over .balena/qemu-execve also to the root folder, but without any success.

Anyway, I created a minimal reproducer repo https://github.com/wngr/balena-multicontainer-reproducer:

  1. build is successful in ./cec
  2. build fails in .

I’d be very glad, if I did a silly mistake.


#5

Turns out (thanks balena support!), that .balena was ignored through .gitignore.

Related issue https://github.com/balena-io/balena-cli/issues/1032