Multi-stage builds

I’m just starting out with resin but I have managed get an .net core “hello world” app deployed on a raspberry pi.

To get .net core build working I needed to use two containers one to do the build and cross compile to arm then another container hold my app. I am currently having to run my build container locally commit my build binaries into git so the resin can package my app using the main Dockerfile.

Now that multi-stage builds have reached stable release is there anyway I can use this feature to get my build container running on the resin servers?

Sure @gambrose, this feature is in production now so you can use it for your project.

That’s great news.

How does resin know which container is to one that needs to be deployed and which is the build container? Does it just take the last container produced as the one to deploy?

Resin knows the same way as Docker uses multi-stage builds, and Docker knows which one to run (and indeed, it’s the last container). So there shouldn’t be anything special required on your side. :slight_smile:

Is there anyway to get this in local development mode. I’m using a BBB and currently a few versions behind at 2.0.3-dev and I was just wondering if it was worth me upgrading to 2.0.6+rev2-dev to enable this at the hassle of having to re-flash and setup my data directory again.

Hey @ItsGhost, the current resinOS release is using Docker 17.03 which does not have the multistage build functionality just yet (was released in 17.05). We are preparing 17.06 which will have that feature and multistage builds will be available for that. Not sure about the timeline, but will keep you posted!

1 Like