DynamicDevices / ming-original

Balena.io/Docker-compose repo for a containerised #MING (Mosquitto, InfluxDB, NodeRed, Grafana) stack
33 stars 20 forks source link

Can't use %%BALENA_ARCH%% to inform --platform in FROM directive in Dockerfiles as they are incorrect, according to DockerHub #24

Open MatthewCroughan opened 4 years ago

MatthewCroughan commented 4 years ago

Simply put, the docker hub wants armv7 but the variable %%BALENA_ARCH%% returns armv7hf. Without specifying a build arg via the Balena CLI, this isn't possible to change. This is useless considering the templating language already kind of implements what we would be doing with the balena cli, allowing us to make Dockerfile.raspberrypi3 and being able to specify --platform=linux/armv7 in it.

This issue relates to #6 #21 and https://github.com/balena-io/balena-cli/issues/1508 heavily, as a resolution of 1508 would remove this problem, or supporting Docker Buildkit.

MatthewCroughan commented 4 years ago

The .template will benefit from the use of these variables, though this limits us as we can no longer support arm devices via this template, only things that by chance happen to match up with the docker hub, such as amd64 or arm64. Raspberry Pi's are unaffected so long as we use their template extension, e.g .raspberrypi3, so this isn't too concerning. Though it is a bit annoying that Balena still does not support this basic feature.

This can be closed once https://github.com/balena-io/balena-cli/issues/1408 is closed and we removed all --platform commands from the project, as they should not be required.