Building container for balena

I’m looking to deploy some software (Falcon Player) as a container on a balena device. This package is designed and intended to run on a Pi. Ultimately, I’d like it to be just ‘one of several’ deployed as part of @chrisys most excellent Festive LED project, as discussed at length elsewhere.

Here’s where my #N00bness kicks in: I’m able to build and run the container locally, on my Macbook Pro (which actually confuses me a bit, given the different architecture).

I’m working through the ‘container’ documentation, here:

but when I ‘balena push’ this image up into an application - the build fails. When I dig in, the underlying error doesn’t actually surprise me - as the step is referencing a balena component which doesn’t exist:

ADD failed: stat /var/lib/balena32/tmp/docker-builder257180624/SD/buildVLC.sh: no such file or directory

This doesn’t surprise me because I’ve done nothing to balena-ize the code / project. I’ve searched the documentation and forums - but not coming up with the answer. Starting in on a couple of the masterclasses and trying to increase my overall balena understanding and skillz. I welcome any #RTFM links or smack to the head that help get me on track for what seems should be a fairly straightforward task. BTW: I tried the ‘shot-in-the-dark’ change, referencing a thread elsewhere about building Pi images – and changed the:

FROM debian:buster

to:

FROM balenalib/armv7hf-debian

But this seemed to have no effect on the error I’m encountering.

Happy Holidays!
Billy

Hello

Probably context is missing/different

On the examples:
We have struct
/asd
/asd/ttt
/bbb
blabla.sh
Dockerfile

docker build -t xxx . -f Dockerfile
This command will pass context . so in Dockerfile cataloguje asd bbb and blabla.sh are visible

docker build -t xxx bbb -f Dockerfile - only bbb catalogue is visible

In dockerBuild.sh there is
docker build -t falconchristmas/fpp:latest -f Docker/Dockerfile .

So they are passing context as . but dockerfile from Docker, you are probably building from Docker/ context

I just balenified it, so check the commit out

I didn’t test the functionality, just that the build passed after ADD SD/buildVLC.sh

Happy Christmas!

2 Likes

@Razikus thanks for solving this. The trick was indeed to move the Dockerfile in the parent directory as Dockerfile.template.

The Falcon Player build script invokes: docker build -t falconchristmas/fpp:latest -f Docker/Dockerfile . The Dockerfile is inside a Docker directory. When using balena the Dockerfile or the Dockerfile.template file has to be in the root folder. This way COPY and ADD operations will be able to access the subfolders.

Merry Christmas to you all!

1 Like

Outstanding! Big thanks to both @Razikus for jumping in and providing a solution - and @majorz for confirming and providing additional context and explanation. #Learning

Merry Christmas, Happy Holidays and Peace!
Billy

Interesting: I still doesn’t quite build / complete – it seems to choke on building VLC. But it definitely gets a LOT further than it was, before. I’ll have to find time to really dig in and see what’s going on: Silly me, I thought this was going to be a fairly trivial undertaking. :smiley:

Cheers!
Billy