Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contiker: Contiki-NG's Docker image #183

Merged
merged 4 commits into from
Nov 29, 2017

Conversation

simonduq
Copy link
Member

@simonduq simonduq commented Nov 16, 2017

This PR brings Docker support for the NG toolchain and development environment (Dockerfile under tools/docker). It also uses the Docker image in Travis tests, so that one can exactly reproduce the Travis environment locally. It builds on #165 for cleaner CI tests, and reworks the CI framework further. More consistent scripts across the tests, and more readable test logs.

I have tested this on a Linux 64-bit host. The Docker image builds from a 32-bit Ubuntu, as required for Cooja "Contiki motes".

To get started, you can either build the image or download it from Docker Hub. To build it:

cd contiki-ng/tools/docker
docker build -t contiki-ng .

To download it:

docker pull simonduq/contiki-ng

For convenience, one can use an alias such as (tested only on Linux):

export CNG_PATH='<ABS_PATH_TO_YOUT_CONTIKI_NG>'
alias contiker="docker run --privileged -v $CNG_PATH:/home/user/contiki-ng -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -ti simonduq/contiki-ng"

The container uses a bind mount to directly access the Contiki-NG repo form the host. This is what Travis uses (it git clones on the host, then starts a container with direct access to the cloned git). This is also handy as a development environment, as it leaves the Contiki-NG git clone no the host, i.e. accessible by editors installed in the host.

We also provide as an alternative a standalone image, with Contiki-NG and pre-compiled Cooja included. The image is also on Docker Hub, just pull simonduq/contiki-ng:standalone.

With the alias above, one can then start a bash:

contiker bash

or even just:

contiker

Run a particular command:

contiker bash -c "make -C examples/hello-world TARGET=zoul"

Or even run Cooja directly, provided one has a X server running on the host, and DISPLAY points to it:

contiker cooja

There is one particular 6top test that does not pass. @yatch , any clue what the problem might be?
https://travis-ci.org/simonduq/contiki-ng/jobs/303194585

To reproduce:

docker pull simonduq/contiki-ng
contiker bash -c "make -C tests/16-6tisch 02-cooja-test-sixp-pkt.testlog"

Or contiker cooja, open and run the 02-cooja-test-sixp-pkt.csc.

@simonduq simonduq force-pushed the contrib/docker branch 4 times, most recently from 4824bc3 to fabdcd6 Compare November 17, 2017 12:43
@simonduq
Copy link
Member Author

6top problem solved, thanks @yatch !

@simonduq simonduq force-pushed the contrib/docker branch 5 times, most recently from 87f9d18 to b6b7797 Compare November 18, 2017 10:28
@simonduq simonduq mentioned this pull request Nov 18, 2017
@simonduq simonduq force-pushed the contrib/docker branch 16 times, most recently from 02eb4a2 to a24f483 Compare November 18, 2017 20:45
@simonduq simonduq mentioned this pull request Nov 29, 2017
@joakimeriksson joakimeriksson merged commit 0e93d1d into contiki-ng:develop Nov 29, 2017
@simonduq simonduq deleted the contrib/docker branch March 27, 2018 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants