Network mode during build step.

Our build step depends on a VPN that is accessible on the host. docker-compose allows setting the network mode to “host” during build by using the “network” build context setting. However this setting was only added in their version 3.4 of the docker-compose.yml format. Balena’s format is based on version 2.2 so this option is not available.

Are there any plans to update the format, allowing for configurations like the one mentioned above?

Hello!

Could you share a little more about your specific requirements? While we don’t support the build.network setting, you might be able to achieve your goal through other means.

For example, I assume you are making the builds locally on your own infrastructure (because the “normal” balena builds triggered by a balena push will build on the balena servers), so I believe you shall be able to deploy your pre-built images using balena-deploy.

If that suggestion does not make sense for your specific case, please let us know your use case a little better and we might be able to find a solution.

Thank you for your response @lmbarros . We are indeed building locally using balena build and afterwards deploying using balena deploy. The problem is in the balena build step, where the Dockerfile's are downloading packages using our VPN (which the host is connected to). In order for the build step to correctly download the packages, it must use the host network (or connect to the VPN itself, but this is something I wish to avoid).

ps. the current workaround we have is to build using docker build, push these images to our private registry and let balena pull the images from that registry. It would still be a nice-to-have to set the network mode for balena in docker-compose.yaml though.

Hi @hgaiser! Thank you very much for sharing the details! I am afraid I don’t have a better suggestion for you at the moment (compared to your current workaround), but I have captured your request so that we can track it internally.