Resin unattended deploy

Is it possible to push to Resin in an unattended way? I have a Dockerfile that takes a long time to compile. Is it possible to do push to Resin, then turn off my PC and check the result later?

Thank you!

I am afraid that would not be possible. The push is done using git and this does not provide such a mode for its operations.

1 Like

Hey @hecontreraso, an alternative option is to use the the resin-cli: you can use resin build to build an image locally, and then resin deploy to send that image to the resin services. This way, you can run the build whenever you have the time, and deploy whenever you have time. Check out the help for these two options.

For example, you can go to the folder containing your application code, and

resin build --application <APPNAME> --tag mybuild .

where you would replace <APPNAME> with your application name. This allows the CLI to correctly guess the target platform (ARM, X86, …), and build for that accordingly. If you are building for an ARM device (like Raspberry Pi), then probably you want to run “emulated” builds, that allows you to do the build for ARM devices even on X86 machines:

resin build --application <APPNAME> --tag mybuild --emulated .

The tagging allows you to easily refer to the resulting build later (and of course you can use any other name than mybuild:

resin deploy <APPNAME> mybuild

Which then takes your local container and deploys to the given application, and it only takes network transfer, not building time.

Hope this helps, let us know if you try it out and have any feedback! :mag_right:

1 Like

This is awesome

1 Like

@imrehg I’m getting this error. I have not been able to build it locally yet05 PM

What am I doing wrong?

@hecontreraso is there Docker running on your machine? resin build tries to connect to the local Docker instance, and I got an error like this when my Docker wasn’t running (and we need to improve on the error message for sure…)

(as a sidenote, if your build machine is not the same architecture as your target, you might need to run this command with --emulated, e.g. if you are building on a normal laptop, for a Raspberry Pi, but that’s just a sidenote, not the cause of this particular error.)

Indeed, I didn’t have docker properly configured. Now it works (:

1 Like

Awesome news! :smiley:

1 Like