devben-io / docker-portfolio

Dockerized version of Portfolio Performance - An open source tool to calculate the overall performance of an investment portfolio
https://www.portfolio-performance.info/
MIT License
56 stars 12 forks source link

Multi arch image #arm #raspberrypi #15

Open vutsalsinghal opened 1 month ago

vutsalsinghal commented 1 month ago

Hi There,

Any possibility that you create a multi arch image and publish it on ghcr.io/dockerhub. I would love to selfhost this on my raspberrypi!

paswai commented 1 month ago

Hi, I tried my luck (no docker experience and not a programmer). I changed some reference *-linux.gtk.aarch64.tar.gz and additionally "FROM jlesage/baseimage-gui:alpine-3.12-glibc-v3 AS base" to "FROM jlesage/baseimage-gui:alpine-3.19-v4 AS base". During the build process, two warnings occur and I am sure that I chose the wrong alpine version :

  2 warnings found (use --debug to expand):
 - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 16)
 - UndefinedVar: Usage of undefined variable '$APP_NAME' (line 20)

Maybe somebody else can solve the problem :-/

# Pull base image.
# FROM jlesage/baseimage-gui:alpine-3.12-glibc-v3 AS base
FROM jlesage/baseimage-gui:alpine-3.19-v4 AS base

# System config
RUN apk --no-cache add ca-certificates wget curl && update-ca-certificates && \
    add-pkg \
        openjdk11-jre \
        gtk+3.0 \
        dbus-x11 \
        dbus \
        webkit2gtk

FROM base as app

# ENV vars
ARG VERSION
ENV APP_NAME=${APP_NAME:-"Portfolio Performance"}

# Download & install App
## if $VERSION is not set via --build-arg -> fetch latest PP version
RUN export VERSION=${VERSION:-$(curl --silent "https://api.github.com/repos/portfolio-performance/portfolio/releases/latest" |grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')} && \
    cd /opt && wget https://github.com/portfolio-performance/portfolio/releases/download/${VERSION}/PortfolioPerformance-${VERSION}-linux.gtk.aarch64.tar.gz && \
    tar xvzf PortfolioPerformance-${VERSION}-linux.gtk.aarch64.tar.gz && \
    rm PortfolioPerformance-${VERSION}-linux.gtk.aarch64.tar.gz

# ENV vars
ARG LOCALE
ENV APP_ICON_URL=https://www.portfolio-performance.info/images/logo.png

# Configure App
## if $LOCALE is not set via --build-arg -> use en_US locale
RUN sed -i '1s;^;-configuration\n/opt/portfolio/configuration\n-data\n/opt/portfolio/workspace\n;' /opt/portfolio/PortfolioPerformance.ini && \
    echo "osgi.nl=${LOCALE:-"en_US"}" >> /opt/portfolio/configuration/config.ini && \
    chmod -R 777 /opt/portfolio && \
    install_app_icon.sh "$APP_ICON_URL"

# Copy files to container
ADD rootfs /