AndrewFromMelbourne / raspi2png

Utility to take a snapshot of the Raspberry Pi screen and save it as a PNG file
MIT License
213 stars 78 forks source link

Building a docker container doesn't work #37

Open dinandmentink opened 1 year ago

dinandmentink commented 1 year ago

I'm trying to build a docker container, which will be run on a raspberry pi 4, that includes this tool. However, while building from debian:bullseye during the Make command I get this error:

#0 1.100 make: *** [Makefile:17: raspi2png.o] Error 1
#0 1.105 cc -Wall -g -O3 -I/usr/include/libpng16 -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -g -c raspi2png.c -o raspi2png.o -Wno-deprecated-declarations
#0 1.132 raspi2png.c:40:10: fatal error: bcm_host.h: No such file or directory
#0 1.132    40 | #include "bcm_host.h"
#0 1.132       |          ^~~~~~~~~~~~
#0 1.132 compilation terminated.
#0 1.134 make: *** [Makefile:17: raspi2png.o] Error 1

This is the Dockerfile setup:

FROM debian:bullseye

RUN apt-get update && apt-get install -y \
  build-essential \
  curl \
  git \
  libpng-dev \
  libpng16-16 \
  sudo \
  && apt-get autoremove \
  && apt-get clean \
  && rm -rf /var/lib/apt/lists/*

RUN curl -sL https://raw.githubusercontent.com/AndrewFromMelbourne/raspi2png/master/installer.sh | bash -

Am I missing something? Any hints/suggestions/pointers?

This should work, right?

viegelinsch commented 5 months ago

On a Raspberry Pi 4 without docker - same error message. sudo apt install libraspberrypi-dev -y solved the problem. Compilation ran just fine.