Docker performance problems running spring application on raspberry pi

Viewed 160

I'm using a raspberry pi 4 as server, where I'd like to run a spring boot application on.

Starting the .jar file like java -jar application.jar the startup takes only few seconds and simple @Get-Request with DB select takes few ms.

I tried to run my application using docker, but I experience huge performance problems using same .jar-File. Startup takes about 3 minutes, simple @Get-Request with DB select takes 5-7 seconds. When running same container on Mac, everything is very smooth, so it must be an issue with the pi or it's configuration.

I installed docker using curl -sSL https://get.docker.com | sh without modifying any configuration.

My workflow:

Creating .tar file:

// Dockerfile
FROM openjdk:8-jdk-alpine
ARG JAR_FILE=*.jar
COPY ${JAR_FILE} application.jar
ENTRYPOINT ["java","-jar","/application.jar"]

> docker buildx build --platform linux/arm/v7 -t example.com/application .
> docker save --output application.tar example.com/application:latest

Copy .tar file to raspberry and starting container:

sudo docker load -i application.tar
sudo run -p 8088:8088 example.com/application:latest
0 Answers
Related