<div dir="ltr"><div>Got snappy+docker solution working.<br><br></div><div>I packed a few steps in this repository to run snappy from qemu but network still lack unfortunately (<a href="https://github.com/muka/qemu-snappy-experiments">https://github.com/muka/qemu-snappy-experiments</a>). <br><br></div><div><br></div><div>Best<br></div><div>Luca<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-01-22 10:01 GMT+01:00 Luca Capra <span dir="ltr"><<a href="mailto:luca.capra@gmail.com" target="_blank">luca.capra@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Thank you,<br></div><div>this example is the "next step" after the environment setup<br><br>Interesting either how you handle the arch in the structure and the startup script in the repo, will follow it for guidance!<br></div><br></div><div>Best<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888">Luca<br></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2016-01-22 9:49 GMT+01:00 Woodrow Shen <span dir="ltr"><<a href="mailto:woodrow.shen@canonical.com" target="_blank">woodrow.shen@canonical.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The another approach is still using cross compile to build any package (with nodejs ?) what you want. <div>Then you need to follow snap format to put all necessary files (binary, configs, or db) into fake-like rootfs. </div><div>For example, the structure can be as follows:</div><div><br></div><div><div>├── conf</div><div>│   └── defaults.ini</div><div>├── magic-bin</div><div>│   ├── arm-linux-gnueabihf</div><div>│   ├── grafana</div><div>│   ├── start-service.sh</div><div>│   └── x86_64-linux-gnu</div><div>├── meta</div><div>│   ├── grafana.apparmor</div><div>│   ├── grafana.seccomp</div><div>│   ├── icon.png</div><div>│   ├── package.yaml</div><div>│   └── <a href="http://readme.md" target="_blank">readme.md</a></div><div>├── usr</div><div>│   └── share</div><div>└── var</div><div>    └── log</div></div><div><br></div><div>Make sure your package.yaml to contain all the snap information, and use `snappy build </path-to-your-top-dir>` to generate a snap.</div><div><br></div><div>Here is my snap for reference: <a href="https://github.com/woodrow-shen/grafana-multi-snap" target="_blank">https://github.com/woodrow-shen/grafana-multi-snap</a></div><div><br></div><div>Have snap fun!</div></div><div class="gmail_extra"><div><div><br><div class="gmail_quote">On Fri, Jan 22, 2016 at 4:32 PM, Luca Capra <span dir="ltr"><<a href="mailto:luca.capra@gmail.com" target="_blank">luca.capra@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Ok, got it! I will try this way.<br></div><br></div><div>Thank you,<br></div>Luca<br><div><div><div><div><br></div></div></div></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2016-01-22 9:22 GMT+01:00 Aiken Qi <span dir="ltr"><<a href="mailto:aiken.qi@canonical.com" target="_blank">aiken.qi@canonical.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Steps</div><div>1. install Snappy Ubuntu Core on RPi 2 <a href="https://developer.ubuntu.com/en/snappy/start/raspberry-pi-2/" target="_blank">https://developer.ubuntu.com/en/snappy/start/raspberry-pi-2/</a> <br></div><div>2. Install Docker app within your Snappy OS on RPi2</div><div>3. Import docker image from docker hub, I was using this <a href="https://hub.docker.com/r/ioft/armhf-ubuntu/" target="_blank">https://hub.docker.com/r/ioft/armhf-ubuntu/</a></div><div>4. Run Ubuntu Core as container, and you will have the arm ubuntu for snappy development. </div></div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><span style="color:rgb(136,136,136);font-size:12.8000001907349px"><br></span></div><div><span style="color:rgb(136,136,136);font-size:12.8000001907349px">Regards,</span></div><div dir="ltr"><span style="color:rgb(136,136,136);font-size:12.8000001907349px">Aiken Qi |Director Alliances PRC | Canonical Ltd | Beijing| China | <a href="tel:%2B86%2013683072422" value="+8613683072422" target="_blank">+86 13683072422</a></span><br></div></div></div></div></div></div></div></div></div></div></div></div></div><div><div>
<br><div class="gmail_quote">On Fri, Jan 22, 2016 at 4:15 PM, Luca Capra <span dir="ltr"><<a href="mailto:luca.capra@gmail.com" target="_blank">luca.capra@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Thank you Aiken<br></div>I'm not sure I've understood what you suggest, sorry :)<br><br></div>Install ubuntu core on RPi and install docker on it to run an ubuntu arm where to run my build?<br><br></div></div>Best<span><font color="#888888"><br></font></span></div><span><font color="#888888">Luca<br></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2016-01-22 2:08 GMT+01:00 Aiken Qi <span dir="ltr"><<a href="mailto:aiken.qi@canonical.com" target="_blank">aiken.qi@canonical.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>Luca,</div><div><br></div><div>Suggest you use docker on RPi snappy, and use Ubuntu core docker image for armhf. It's quite straight forward for native compile.<br><br><div>Regards<span><font color="#888888"><br>Aiken Qi <br><a dir="ltr" href="tel:13683072422" target="_blank">13683072422</a></font></span></div><br></div><div><div><br><br><br>
<div class="gmail_quote">On Thu, Jan 21, 2016 at 8:41 AM -0800, "Luca Capra" <span dir="ltr"><<a href="mailto:luca.capra@gmail.com" target="_blank">luca.capra@gmail.com</a>></span> wrote:<br>
<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="3D"ltr"">
<div dir="ltr"><div><div>Thank you Alexander,<br></div>I will try to setup a qemu instance over armv7.. if feasibile.. and try to build from there.<br><br></div>Best, Luca<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-01-21 12:19 GMT+01:00 Alexander Sack <span dir="ltr"><<a href="mailto:asac@canonical.com" target="_blank">asac@canonical.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
cross compilation of nodejs with snapcraft is tricky. If you manually<br>
build/assemble your stuff you can try the instructions on cross<br>
compiling you can find on the web, but for snapcraft the best way is<br>
to go for native building on your pi2...<br>
<br>
For snappy 15.04 you can get a developer ubuntu experience by using<br>
lxd. For snappy 16.04 you can "sudo snappy enable-classic" mode and<br>
then switch into a convenient ubuntu shell where you can apt-get<br>
install etc. with "sudo snappy shell classic"<br>
<br>
My etherpad-lite snap builds nicely that way. See<br>
<a href="https://github.com/asac/etherpad-lite/tree/snap-support/bin/snappy." rel="noreferrer" target="_blank">https://github.com/asac/etherpad-lite/tree/snap-support/bin/snappy.</a>..<br>
<br>
 - Alexander<br>
<div><div><br>
On Thu, Jan 21, 2016 at 12:07 PM, Luca Capra <<a href="mailto:luca.capra@gmail.com" target="_blank">luca.capra@gmail.com</a>> wrote:<br>
> Hello,<br>
><br>
> I've built a service snap out of a nodejs module and would like to cross<br>
> compile it to armv7 for RPi2<br>
><br>
> At this page [1] there is a sample for go but it's unclear to me what's the<br>
> point of it (compile snappy for arm?)<br>
><br>
> Do you have a suggestion/example on how to cross compile snap for nodejs and<br>
> handle compiled dependencies (like with node-gyp)?<br>
><br>
> Thanks, Luca<br>
><br>
> [1] <a href="https://developer.ubuntu.com/en/snappy/guides/cross-building/" rel="noreferrer" target="_blank">https://developer.ubuntu.com/en/snappy/guides/cross-building/</a><br>
><br>
</div></div><span><font color="#888888">> --<br>
> snappy-app-devel mailing list<br>
> <a href="mailto:snappy-app-devel@lists.ubuntu.com" target="_blank">snappy-app-devel@lists.ubuntu.com</a><br>
> Modify settings or unsubscribe at:<br>
> <a href="https://lists.ubuntu.com/mailman/listinfo/snappy-app-devel" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/snappy-app-devel</a><br>
><br>
</font></span></blockquote></div><br></div>

</div>

</blockquote>
</div>
</div></div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>
</div></div><br>--<br>
snappy-app-devel mailing list<br>
<a href="mailto:snappy-app-devel@lists.ubuntu.com" target="_blank">snappy-app-devel@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/snappy-app-devel" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/snappy-app-devel</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br><div><div dir="ltr"><font color="#666666">Regards,</font><div><span style="background-color:rgb(255,255,255)"><font color="#666666">Woodrow</font></span></div></div></div>
</font></span></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>