Matt-Gleich
Posts: 3
Joined: Sat Aug 24, 2019 11:14 pm

Problem with Docker on RPI 3

Sat Aug 24, 2019 11:36 pm

So I am trying to run a docker container that is using python 3 as a base image. I am using one package and it is firebase_admin. When the docker build gets to the pip install -r requirements.txt part, everything looks normal until it starts printing:

Building wheel for grpcio (setup.py): still running...

It keeps printing this over and over again. Please help, thanks.

geev03
Posts: 121
Joined: Thu Jun 07, 2012 12:40 pm
Location: London, UK

Re: Problem with Docker on RPI 3

Thu Aug 29, 2019 8:37 am

Docker images run smoothly on Raspberry Pi 3B & Gentoo 64 bit, https://github.com/sakaki-/gentoo-on-rpi-64bit.

Code: Select all

Login as: geev03
Using keyboard-interactive authentication.
Password:

==============================================================================
|    Welcome to 64-bit Gentoo Linux for the Raspberry Pi 3 Model B & B+!     |
|         MicroSD-card image maintainer: sakaki <sakaki@deciban.com>         |
==============================================================================
| There is ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law |
==============================================================================
|            (Edit, or delete, /etc/motd to modify this message)             |
==============================================================================

geev03@pi64 ~ $ uname -a
Linux pi64 4.19.49-v8-4395da031338-bis+ #2 SMP PREEMPT Tue Jun 11 13:28:12 GMT 2019 aarch64 GNU/Linux
geev03@pi64 ~ $ free -h
              total        used        free      shared  buff/cache   available
Mem:          864Mi       259Mi       345Mi       1.0Mi       259Mi       590Mi
Swap:         1.0Gi          0B       1.0Gi
geev03@pi64 ~ $ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        28G  8.5G   20G  31% /
devtmpfs         10M     0   10M   0% /dev
tmpfs            87M  844K   86M   1% /run
cgroup_root      10M     0   10M   0% /sys/fs/cgroup
shm             433M     0  433M   0% /dev/shm
/dev/mmcblk0p1   63M   33M   31M  51% /boot
none            433M  8.0K  433M   1% /run/user/1000
none            433M     0  433M   0% /run/user/1001
geev03@pi64 ~ $ sudo -i
pi64 ~ # /etc/init.d/docker start
 * Starting docker ...                                                    [ ok ]
pi64 ~ # docker info
Client:
 Debug Mode: false

Server:
 Containers: 4
  Running: 0
  Paused: 0
  Stopped: 4
 Images: 2
 Server Version: 19.03.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
 runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f
 init version: fec3683b971d9c3ef73f284f176672c44b448662
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.19.49-v8-4395da031338-bis+
 Operating System: Gentoo/Linux
 OSType: linux
 Architecture: aarch64
 CPUs: 4
 Total Memory: 864MiB
 Name: pi64
 ID: 27TH:CTTD:E3BU:YP2Q:5EZ2:7R2V:RL7W:LNHZ:NPVT:6WYH:SDNP:XOA6
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

epoch1970
Posts: 3661
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Problem with Docker on RPI 3

Thu Aug 29, 2019 8:59 am

Docker works fine on arm32v7, a 64bit host OS is not a requirement.
The OP has a build issue on one specific application it seems.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

jdonald
Posts: 413
Joined: Fri Nov 03, 2017 4:36 pm

Re: Problem with Docker on RPI 3

Thu Aug 29, 2019 9:33 am

It sounds like gRPC is taking a long time to build, and unfortunately doesn't combine in a binary wheel package for the particular distribution.
Matt-Gleich wrote:
Sat Aug 24, 2019 11:36 pm
using python 3 as a base image.
Saw some problems with python:3.5-buster recently. If you're using anything like that, try debian:buster instead.

If it still insists on building from source, try adding -v to the pip command so you can at least see its steps. Also monitor your memory usage to ensure you don't run out or thrash.

If there's no way to avoid building gRPC from source, you might still be able to speed things up by installing ccache with symlinks, or installing clang and using CC=clang CXX=clang++

Matt-Gleich
Posts: 3
Joined: Sat Aug 24, 2019 11:14 pm

Re: Problem with Docker on RPI 3

Fri Aug 30, 2019 5:27 am

Here is a link to the github repository for the project:

https://github.com/goffstown-sports-app ... endar-Data

The Dockerfile is located there

jdonald
Posts: 413
Joined: Fri Nov 03, 2017 4:36 pm

Re: Problem with Docker on RPI 3

Fri Aug 30, 2019 7:36 pm

Okay it seems to make no difference using python:3.7-buster vs using debian:buster, and if I build with CC=clang it fails due to existing bugs in their process while changing those warnings into fatal errors.

Add -v as I said, and you can speed up the build of grcpio by turning off optimizations, i.e. change the relevant line to:

Code: Select all

RUN CFLAGS=-O0 pip3 install -v -r requirements.txt
Then you can build the container in 15 minutes. Otherwise expect to wait hours. It's ridiculous how pip3 can't just fetch everything for "firebase_admin".

Matt-Gleich
Posts: 3
Joined: Sat Aug 24, 2019 11:14 pm

Re: Problem with Docker on RPI 3

Sat Aug 31, 2019 10:57 pm

Switching to python:3.6-stretch from python:3.7-stretch fixed it.

Return to “Troubleshooting”