firoorg / firo

The privacy-focused cryptocurrency
https://firo.org
MIT License
720 stars 354 forks source link

Dockerfile update; Add amd64/arm64 support #1226

Closed mksdev closed 1 year ago

mksdev commented 1 year ago

PR intention

Fix docker builds from Dockerfile provided in the repository. Adds support for multiarch builds.

Code changes brief

Updates old Dockerfile with newest debian base image. Builds for x86 (x86_64) and arm64 (aarch64) architecture.

Build using buildx (takes 2h+ for non-native version)

docker buildx build \
    --tag username/firo:latest \
    --platform linux/amd64,linux/arm64 \
    --push \
    .

Build on separate machines and merge it with manifest (takes around 20minutes with native build)

# build and push on amd64 machine
docker build --tag username/firo:latest-amd64 .
docker push username/firo:latest-amd64

# build and push on arm64 machine
docker build --tag username/firo:latest-arm64 .
docker push username/firo:latest-arm64

# merge it to multiarch image
docker manifest create username/firo:latest \
    --amend username/firo:latest-amd64 \
    --amend username/firo:latest-arm64
docker manifest push username/firo:latest

You can check multiarch builds here https://hub.docker.com/r/mksdev/firo/tags mksdev/firo:master - this PR master branch mksdev/firo:latest mksdev/firo:v0.14.12.0 - v0.14.12.0 commit https://github.com/firoorg/firo/commit/b8abba9ee8b85bbbab6d34b283da3935096e7747

docker run --rm -it mksdev/firo:master

Still needs to be checked

For firoorg/firod:latest the version is printed as Firo version v0.14.12.0-gb8abba9ee, but this build reports as Firo version v0.14.12.0-unk.

Using ./configure with --without-gui --enable-tests. Maybe there are different options used for official builds.