Legato docker cross compilation


#1

Hello everyone,

I have some issues with Docker. I have all legato containers but I don’t know how to call my Makefile with theses docker containers to compile for WP85 on my macintosh.

Do you have any examples? I don’t really know how to use docker run stuff, thank you very much.


#2
  • Run docker --help to make sure that you have docker installed properly and that it’s in your $PATH.
  • Run docker images to view the list of images that docker knows about
  • Run docker run -it -v $LEGATO_ROOT:/legato <image_repository>:<image_tag> bash

The final command above will mount the directory contained in $LEGATO_ROOT into the docker environment at /legato and then will run bash. You can then do cd /legato followed by make wp85 to build. The image_repository and image_tag values can be obtained from the docker images command before. I’m not actually using the docker toolchain myself, so I don’t know what the exact names are.


#3

Hi @jlouis

How did you get the Docker images on your Mac?
The usual way is to use Developer Studio package manager. Then you can use Developer Studio to build you projects on Mac.
If you want to do it from the command line only, this is doable as well.
Please just tell where you want to go, and we’ll give you the instructions :wink:


#4

Thank you for your answers.

I get all docker images from legato hub: https://hub.docker.com/u/legato
I download some images like toolchain, ds-runtime and framework.

I would like to have cross-compilation from my macintosh command line, I tested the developer studio, it’s a nice Eclipse integration, well done! I will take a look but from now I have to write an application for a meeting and I’m better with my macintosh and vim habits :slight_smile:

If you have instructions about this kind of configuration to build for example a local hello world it will be very usefull, thank you very much.

I discovered docker few weeks ago :smile:


#5

Actually, toolchain, ds-runtime and framework images are sort of deprecated.
This was the way we were manage images about one year ago (Legato 16.01.* versions).
The issue was that for pure command-line use case, it was too complicated to setup all the containers to make them working together.

We’re now working with sdk images, that are baselining all the necessary stuff in one image.
What you have to do is:

docker pull legato/sdk:16.10.1-wp85-wp750x-201701091127

This will download the lastest SDK version for WP85.
Then:

docker run --rm -it -v $MYPATH:/shared -w /shared legato/sdk:16.10.1-wp85-wp750x-201701091127 /bin/bash

This will start a bash shell inside the Legato SDK container. You will have everything set to play with Legato tools (mkapp, etc…)
$MYPATH needs to be a path on your host, that will be shared with the container.

Hope this will help.


#6

Ok, well I was playing with wrong images, thank you it works well!


#7

Which docker image is mandatory to cross-compile for testing with “localhost”? Thank you very much again


#8

Hi @jlouis

I guess you mean building the Legato framework?
First of all, please note that if you only intend to develop apps, the Docker image already includes all the necessary pre-built stuff for this use case, so you don’t need to build the framework again.

If you want to go further and rebuild the Framework (and/or even maybe the Yocto distribution), you’ll probably need to switch to a Linux host for a better user experience.
The Docker legato/sdk image is not including all the necessary dependencies required to build the framework from the source code.