Docker

From PaparazziUAV
Revision as of 04:09, 10 March 2016 by Flixr (talk | contribs) (→‎On Mac)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Docker is an open platform used to build, ship, and run distributed applications. You can learn more about Docker by visiting its website, https://docker.com.

In particular, if you're just getting started using Docker with Paparazzi, we encourage you to make use of the following resources:

  • What is Docker - A page that will give you excelent high level overview of Docker and its purpose.
  • Documentation - Browse the online documentation and references to find information about Docker's various functions and tools.
  • Forums - If you need help, just ask! Docker has a great user community, with lots of people willing to help answer any questions you might have.
  • Mailing list - Another way to start a discussion and follow community activities.

For new users of Docker, those resources will provide you with most of the information you'll need to get familiar with the platform. Additional information pertaining to using Docker for Paparazzi can be found on this page.

You can test out Docker right now using a live online tutorial, try it out yourself: Linux / Mac.

We have some images and scripts to easily build/test Paparazzi within a container.

Pulling Paparazzi images

There are prebuilt images containing all the Paparazzi dependencies on Docker hub, which you can just pull:

docker pull flixr/pprz-dep
docker pull flixr/pprz-dev

Or in your local clone of the Paparazzi repository:

cd docker
make pull

The pprz-dep image contains all dependencies, the pprz-dev image adds some convenience stuff and a pprz user. Normally you will want to use the pprz-dev image.

Building and Running Paparazzi inside Docker

You can simply start a shell inside the pprz-dev container

docker run -it flixr/pprz-dev bash

You could now clone the paparazzi repo inside this container and build it. However this does not give you access to the X-Server, USB, etc..

To make Docker more useful to us and enable using and editing Paparazzi files from the host system, the repo contains a helper script. See also https://github.com/paparazzi/paparazzi/pull/1272

Starting a shell (or Paparazzi Center directly) through this script will enable access to the X-Server, USB devices and audio and set mount your current Paparazzi directory in the home directory of the pprz user inside the container. That way you can edit your code and configuration files from your host system using your favourite tools/IDE and then build and use them within Docker.

In your local clone of the Paparazzi repository:

./docker/run.sh -it flixr/pprz-dev bash

or even easier:

cd docker
make bash

And you get a new bash shell inside the Paparazzi Docker container... There you can just run make to build Paparazzi. Once built, you can also directly use make paparazzi or make start accordingly to start the Paparazzi Center or the start.py tool.

Troubleshooting

When using the run.sh script, you are sharing the paparazzi directly between your host system and the Docker container. This means that if you previously had Paparazzi built on your host system, you will need to rebuild it inside the Docker environment (make clean && make).

On Mac

There is currently no audio forwarding on OSX and X-Server access might be slower, see https://github.com/paparazzi/paparazzi/pull/1425

Possibly helpful pages: