Using Yocto layers vs Raspbian for .Net example


#1

Hi all,

I’m just starting with Resin.io so please excuse the newbie questions…

I have a board connected and have pushed the example HelloWorld .NET application to the remote git endpoint. It built up and I could see on the dashboard it started downloading to my Rpiv2 target board.

Looking at the build process and the docker file it looks like it’s making use of Raspbian. I’m a little fuzzy on how Raspian is overlaid on top of the Yocto Resin Distro at the moment.

But what I’d like to do is use meta-mono for my .NET example starting point which I think will give a smaller image (could be wrong here…) and will let me use a more recent build of Mono.

Any pointers as to where I begin?

Thanks, Alex


#2

Hi Alex,

Welcome to resin.io!

So in our Yocto Resin Distro we have Docker daemon(which is basically a really light-weight virtual machine) which runs your application Docker container. In that container you can run the distro of your choice (see FROM command in the Dockerfile) So in this case your application would run in a Debian environment even though resin host OS is a custom yocto disto.

Using meta-mon would lead to smaller images, however we don’t currently have a means to build your own custom resin yocto images, but it is on the roadmap.

What I’d suggest is installing using apt like they outline here using a RUN command in your Dockerfile.

There are also ways to slim down the container image if image size is a big concern.

Let me know how you get along,
Craig


#3

Hi Craig,

Thanks very much for coming back to me and clearing that up!

I don’t want to run before I can walk but we do a lot of work with Yocto and I’m interested to put some time into putting a custom Resin Yocto image together.

There’s a range of value in there for us, in terms of what we do in reusing Yocto across different board platforms and so forth, with Mono support.

I am guessing that Resin is hosting the repo that the Debian packages are pulled from? So would that mean I couldn’t put my own Yocto repo together and pull down with smart? Or do you allow me to break that out and pull from my own repo into a Docker image?

Thanks!

Alex


#4

The more I look at the Resin platform the more impressed I become.

I forked Martin Calsyn’s .NET examples and added a Yocto branch with a modified Docker file to base from some Yocto/meta-mono images I created to replace Raspbian as the base.

All seems to run up and I am pleased to see I can access his web server time endpoint remotely through the Resin URI.

I’ve put three Yocto RPiv2 images I built up on Docker hub (core-image-minimal and two flavours of image with Mono support, UI and Console). Also a few simple examples.

https://hub.docker.com/u/dynamicdevices/

I’m not sure how interesting this will be to you, but for me I am pleased that we seem to be able to use Resin with a standardised Yocto container image which I can then easily re-target at other board platforms.

Cheers, Alex


#5

Hi Alex,

Glad you are enjoying it!

I was going to point you to our custom base-image tutorial but you seem well on your way :slight_smile: We haven’t had many users building yocto base images for their apps but this is very cool to see and I’m sure it will also be very useful to future users.

I’m not sure if it’s super useful to you, but you can also parse machine and arch type variables to our builders which could offer some convenience if you have a convention for naming your custom base-images. You can read our docs for more details.

Cheers,
Craig


#6

That sounds exactly the type of thing I am looking for Craig. Many thanks.