Posts: 1
Joined: Thu Feb 28, 2019 2:54 pm

Docker image for raspbian

Thu Feb 28, 2019 3:19 pm


I have a system setup in which I setup and configure a raspberrypi with some custom scripts. But in order to avoid having to setup a new box "every time" I need to test the overall system, I though about using docker to create an image of the base raspbian and test it locally on my machine (mac).

So, I did:
1- Downloaded 2018-11-13-raspbian-stretch-lite.img
2- Created 2018-11-13-raspbian-stretch-lite.tar.gz
3- Created Dockerfile:
FROM scratch
ADD ./2018-11-13-raspbian-stretch-lite.tar.gz /

4- Ran: docker build -t myproject .
5- Ran: docker run -it myproject bash

After running, apparently all is well. BUT: although in my system, the file /proc/cpuinfo has Serial Number, when I run it with docker as described, /proc/cpuinfo does not contain Serial Number.

What am I missing? Any ideas? If /proc/cpuinfo does not always contain the serial number, where else can it be depending on the image?

Thank you for any pointers

Posts: 18854
Joined: Tue Jul 17, 2012 3:02 pm

Re: Docker image for raspbian

Thu Feb 28, 2019 3:37 pm

How about giving your Docker container access to files outside the container. See Docker documentation and all kind of blogs around the net. For example: ... d-the-host

Or pass the serial number into the Docker container when you start it with the -e option to the run command: ... dline/run/
Memory in C++ is a leaky abstraction .

Return to “General discussion”