Sorry @kodez & @cupacoffee - I've only just noticed these comments. I didn't get any notifications. The github repo (https://github.com/sdt/docker-raspberry-pi-cross-compiler) is probably a better place to raise issues.
If you need to install extra debian packages in the rpxc image, there's a walkthrough here: https://github.com/sdt/docker-raspberry-pi-cross-compiler/tree/master/examples/extra-packages
I'll add some examples on how to install extra libraries from sources. The basic approach is to build the library and install it inside an rpxc container, and then use docker commit to save that container as a new rpxc image. As it stands, rpxc automatically deletes the stopped container, so this needs a little work.
I see your issue there with the docker group - I'll add a note about that.
I've stumbled over some things i want to mention here:
First: The first time i tried to use a command (rpxc gcc my_test.c) on my host-system but that gave me something along the lines:
docker useradd UID 0 is not unique sudo unknown user:
build-user sudo unable to initialize policy plugin
As it turned out i had to get into a user-group in order to get further as using sudo wasn't interpreted as a command but a name. (Which was obviously unknown.) I'd suggest to note somewhere that it's mandatory to be in a docker group.
Here I added my user into a docker group (and restarted my system.)
$ sudo usermod -aG docker student94
$ sudo reboot
Second: In order to use binary files (here: “hello-world”) created with:
$ rpxc rpxc-gcc -o hello-world hello-world.c
you'll have to make the resulting file executable, so the following step is needed on the Pi:
$ chmod +x hello-world
Third: Now I tried to add some library (wiringPi – see Link ). My first try was using the rpxc-utility:
$ rpxc apt-get install git-core
Returns that I dont have permission to perform action, trying as root:
$ rpxc sudo apt-get install git-core
Asks me for my password, it seems to ask for the container-password I dont have.
Fourth: So I logged into the container, even if I was informed the container was not supposed to be run manually. The following command makes you enter the container.
$ docker run -ti sdt4docker/raspberry-pi-cross-compiler sudo bash
[Installation of the wiringPi-components that are interchangeable with any other program or library.]
After the changes I saved these, you will need to open a second terminal to do that, I will mark this with two $-signs. First command to find the id of the running container. .
$$ docker ps -l
This command saves the running container (“79aa4” – will be different for you) to the name “cross-project”
$$ docker commit 79aa4 cross-projekt
And exited the running container from the original terminal.
And I imtated the original steps with my image (again I checked for the new ID):
$ docker run a20e8ff60abf > rpxc
$ chmod +x rpxc
$ mv rpxc /bin/
This approach wasn't successful, maybe I made some mistake. Will keep trying and replacing my posts as I didn't find an edit-function.
Awsome thing this. I love it. I have hit a snag though, i must link with the libxml2-dev package. Is there a way to add libraries to the image?