Dockerfile includes hardcoded amd64

What happened:
The final stage of Grafana’s Dockerfile includes a hard coded amd64, causing the build to fail on aarch64.

What you expected to happen:
Final stage should have pulled “/go/src/github.com/grafana/grafana/bin/linux-arm64/grafana-cli” from the go-builder stage, which does exist. The Dockerfile hard codes amd64, so this step fails. Here is the relevant line:

COPY –from=go-builder /go/src/github.com/grafana/grafana/bin/linux-amd64/grafana-server /go/src/github.com/grafana/grafana/bin/linux-amd64/grafana-cli ./bin/

How to reproduce it (as minimally and precisely as possible):

Build Grafana container on an aarch64 system.

Anything else we need to know?:

It’s possible this is fixed up somewhere else I’m missing, perhaps in a build script of Makefile. I looked around but didn’t see anything.

Environment:

  • Grafana version: 7.4.2 and master
  • Data source type & version: N/A
  • OS Grafana is installed on: RHEL7 for aarch64
  • User OS & Browser: N/A
  • Grafana plugins: N/A
  • Others: N/A

1 possible answer(s) on “Dockerfile includes hardcoded amd64

  1. The Dockerfile in Grafana root is supposed to be an easy and quick way to build a custom Grafana docker image using local changes on a development machine, it is not designed to support all possible platforms or to be used in production. Dev environments generally expect docker to run amd64 binaries. Supporting other platforms is currently out of scope of that docker build script. I’d instead suggest that you build the grafana binaries separately and use the Docker build scripts in https://github.com/grafana/grafana/tree/master/packaging/docker to build a Grafana docker image for the platform of your choice.