ruimarinho / docker-bitcoin-core

A bitcoin-core docker image
https://hub.docker.com/r/ruimarinho/bitcoin-core/
MIT License
365 stars 209 forks source link

Restructured 0.19 Debian build to support ARM builds #90

Closed olljanat closed 4 years ago

olljanat commented 4 years ago

Closes #67

Restructured 0.19 Debian build on way that last stage does not need RUN instructions so it can create ARM image(s) without need to use emulator.

Also dropped bitcoin-qt binary as it doen't work on Docker and only cause unnecessary overhead.

Tested with Raspberry PI 3b+ and Rancher OS 1.5.4 that those images really can run on ARM.

ruimarinho commented 4 years ago

I think the right approach here would be to use buildx. Will explore it in this PR!

tiero commented 4 years ago

I think the right approach here would be to use buildx. Will explore it in this PR!

Just my own experience, I was never been able to cross-compile on my mac arm stuff with buildx.

The more predictable way would be to build on an arm device if you have it, push it with a tag and then pull again and create a manifest for multi-architecture docker hub image.

You can have an example here https://github.com/tiero/docker-bitcoin-core/blob/master/Dockerfile. The same docker image can be build on different archs

With docker manifest, you can pull the same image and automatically will recognize your arch and pull the right tag https://hub.docker.com/r/tiero/bitcoin-core/tags

ruimarinho commented 4 years ago

@olljanat @tiero can you give ruimarinho/bitcoin-core:0.19.1-multiarch a try?

Name:      docker.io/ruimarinho/bitcoin-core:0.19.1-multiarch
MediaType: application/vnd.docker.distribution.manifest.list.v2+json
Digest:    sha256:37c5957cd735f64e4fa0182b9445f1686c94a674837237eb340a5952b66b042b

Manifests:
  Name:      docker.io/ruimarinho/bitcoin-core:0.19.1-multiarch@sha256:05a5242b07b8b18c7c480682e0987e2558b7b01bd768ad1eb74961fff1de581e
  MediaType: application/vnd.docker.distribution.manifest.v2+json
  Platform:  linux/amd64

  Name:      docker.io/ruimarinho/bitcoin-core:0.19.1-multiarch@sha256:68c0ed260a27f71f3d64f9cf42e19f6967540c6f671354560303fe22f570b5cc
  MediaType: application/vnd.docker.distribution.manifest.v2+json
  Platform:  linux/arm/v7

  Name:      docker.io/ruimarinho/bitcoin-core:0.19.1-multiarch@sha256:f4774b3c68569267eaee9c99996718fff267b3c50fa39d406cd0c27b9f18bce5
  MediaType: application/vnd.docker.distribution.manifest.v2+json
  Platform:  linux/arm64
ruimarinho commented 4 years ago

Superseded by https://github.com/ruimarinho/docker-bitcoin-core/pull/93. The -multiarch test image is no longer available and you should use the main 0.19 image instead for multi-arch support. All feedback would be appreciated!