ghostfolio / ghostfolio

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍
https://Ghostfol.io
GNU Affero General Public License v3.0
4.55k stars 466 forks source link

[BUG] "failed to parse platform" on Odroid M1 #1417

Open httpiga opened 2 years ago

httpiga commented 2 years ago

The Issue tracker is ONLY used for reporting bugs. New features should be discussed on our Slack channel or in Discussions.

Bug Description I can't build docker image on a Odroid M1 (see output below). Development enviroment builds successfully. I think that it fails to recognize the platform, returning an invalid empty string. Is there a way to manual override $BUILDPLATFORM?

To Reproduce

  1. git clone https://github.com/ghostfolio/ghostfolio.git
  2. cd ghostfolio
  3. docker-compose --env-file ./.env -f docker/docker-compose.build.yml build
  4. Output:
    postgres uses an image, skipping
    redis uses an image, skipping
    Building ghostfolio
    Sending build context to Docker daemon  13.78MB
    Step 1/32 : FROM --platform=$BUILDPLATFORM node:16-slim as builder
    failed to parse platform : "" is an invalid component of "": platform specifier component must match "^[A-Za-z0-9_-]+$": invalid argument
    ERROR: Service 'ghostfolio' failed to build : Build failed

Expected behavior Docker build to complete or, as an alternative, the user should be able to manually specify BUILDPLATFORM variable.

Environment

httpiga commented 1 year ago

Editing first line of Dockerfile by replacing FROM --platform=$BUILDPLATFORM with FROM --platform=${BUILDPLATFORM:-linux/arm64} allowed me to complete the build.

dtslvr commented 1 year ago

Hi @httpiga

Glad you could manage to find a solution!

Do we need to change something in our Dockerfile or can we just close this issue?

httpiga commented 1 year ago

I don't think a change in Dockerfile is needed since my fallback only works for arm64 architectures. I'd rather suggest adding a fallback using a new .env defined argument, so that every user can specify the architecture he's using. WDYT?

dtslvr commented 1 year ago

How would that look like specifically?