Enable DOCKER_BUILDKIT in balena cloud builders

Hi!

We have a project for which we use Bitbucket pipelines to build our project. In the past we used balena push to build and deploy our application (raspberry-pi 4). However for a change of requirements we now need to mount an ssh socket using the --mount option.

Error: the --mount option requires BuildKit.

Is there a way to enable buildkit in the Balena Cloud builders?

Thanks!

Hello, unfortunately neither enabling buildkit nor mounting an ssh socket are currently supported on our cloud builders.

Hey @pablo.burgos , if you’re looking for more advanced image building options that our builders don’t provide, might I suggest building it using the build tool of your choice within CI, and deploying to balena with balena deploy? Let us know if you encounter any issues with this.

Hi @cywang117 thanks for your input :slight_smile:

We tried but it was a bit slow since we need to crosscompile. In the end this is the problem and solution that we found:

Objective: fetching private Go modules from within Bitbucket pipelines using internal ssh keys from Bitbucket.

Problem: --mount requires BUILDKIT enabled but it’s not possible in Balena Cloud builders

Solution: use go mod vendor from the Bitbucket pipeline to gather all dependencies from an authorized environment, then balena push the code using the “vendored” dependencies in the build.

This is probably useful in other CI/CD environments too