Docker multistage build --target argument

  • the env vars method is for runtime, not build time. So won’t work for you unfortunately.

  • if you are using balena push AppName --source, that unfortunately looks for a directory and not a Dockerfile. So it won’t work if you passed that in this case. Have you used balena deploy? This would let you point to a dockerfile with the --dockerfile <dockerfile> flag. My colleague has explained the difference between balena deploy vs balena push - balena push vs build and deploy - #2 by dfunckt
    I think this should work well for you

  • the development and production images are for the underlying balenaOS - and not for the user’s containers. The development image has some things like a passwordless root ssh access. You can find more about it here - What is balenaOS? - Balena Documentation
    The idea is that you will use the development image for device that you want to quickly debug during the development cycle. And the production images are what you actually flash on the devices that you deploy. Local mode is one of our main advantages that allows you to rapidly make changes to a development image.