Just few days before I started looking on the balena and I am very much like this concept.
I installed the open balena in my server(vps) and installed a Java application on my raspberry-4. I could successfully deploy application in my RPi. When the application started I am blinking an LED bulb which is attached to the Pi. So I used Pi4J lib for controlling the GPIO ports. This is worked in Raspbian OS before. But when I deployed in balena I am getting the exception like “java.lang.UnsatisfiedLinkError: ‘int com.pi4j.wiringpi.Gpio.wiringPiSetup()’” because another exception throwing before this which is “ERROR com.pi4j.util.NativeLibraryLoader - Unable to load [libpi4j.so] using path: [/lib/raspberrypi/dynamic/libpi4j.so]”
I think this is because of the missing of “wiringpi”. I installed it in the image,but still getting the same exception. I pasted the content of Dockerfile below. Please verify I am not sure I followed the correct steps.
For Raspbian the wiringpi is already installed. In this case I used the base image “balenalib/raspberrypi4-64-ubuntu-openjdk:11”.
My question is, Can I use any image with raspbian os which works in the Balena Engine?
If it is NOT, any solution for this issue?
FROM maven:3.5-jdk-8-alpine AS build
RUN apk update
RUN apk add --no-cache git
ADD settings.xml /root/.m2/settings.xml
COPY . /build
RUN mvn -f /build/pom.xml clean package -DskipTests
RUN apt-get update && apt-get install -y git && apt-get install -y build-essential
RUN git clone https://github.com/WiringPi/WiringPi.git wiringpi && cd wiringpi && git checkout tags/final_official_2.50 && ./build
RUN cd …
RUN apt-get install -y maven
RUN git clone https://github.com/Pi4J/pi4j-v2.git pi4j && cd pi4j && mvn clean install
#RUN gpio -v
COPY --from=build /build/target/my-device-1.0.jar my-device.jar
ENTRYPOINT [“java”, “-jar”, “my-device.jar”]
Thanks & Regards