Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added M1 support to docker files #351

Merged
merged 6 commits into from
Jun 14, 2021
Merged

Conversation

Dmdv
Copy link
Contributor

@Dmdv Dmdv commented Jun 9, 2021

Fixing docker builds of AMD/Intel on Apple M1 chips

You can use buildkit, and then:
docker buildx build --platform linux/amd64 .
or change Dockerfile definition with
FROM --platform=linux/amd64 golang:1.12.4-alpine3.9

Testing

Following scripts support flags: m1, -m1, --m1

./docker.local/bin/build.base.sh -m1
./docker.local/bin/build.miners.sh -m1
./docker.local/bin/build.sharders.sh  -m1
./docker.local/bin/build.magic_block.sh -m1

Prerequisites:

https://docs.docker.com/docker-for-mac/apple-silicon

Other links:

https://docs.docker.com/buildx/working-with-buildx
https://docs.docker.com/engine/reference/commandline/buildx

@guruhubb guruhubb requested a review from mallochine June 9, 2021 05:36
Copy link
Contributor

@mallochine mallochine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should also make a note in top-level README.md regarding how to use your script if dev needs to compile on m1 chip.

docker.local/bin/build.sharders.apple.sh Outdated Show resolved Hide resolved
@mallochine
Copy link
Contributor

ok tested, all the build commands work on my machine

@Dmdv
Copy link
Contributor Author

Dmdv commented Jun 10, 2021

@mallochine Could you pls check again after the fix

@Dmdv
Copy link
Contributor Author

Dmdv commented Jun 10, 2021

@mallochine ready for review

@Dmdv
Copy link
Contributor Author

Dmdv commented Jun 12, 2021

@mallochine Anything else from my side to push this PR?
1 workflow awaiting approval

@mallochine mallochine merged commit df7fc12 into 0chain:master Jun 14, 2021
@Dmdv Dmdv deleted the fix/apple_m1_docker branch June 14, 2021 15:55
peterlimg added a commit that referenced this pull request Jul 11, 2021
* master: (23 commits)
  🐛 writePoolLock creats a new wrteipool if non exists (#383)
  ✨ Add immutable allocations (#375)
  ✨ Select diverse blobbers by geo location (#315)
  ✨ Blobber block rewards (#317)
  📚 Unit test doc (#325)
  ✨ Free storage allocation (#358)
  Fixes for smart contract blobber add/update methods (#361)
  ✨ Add curator and transfer allocatin ownership (#366)
  read pool lock creat read pool (#377)
  add condition check to handle empty block hash #297
  Update state_handler_test.go
  Update state_handler_test.go
  Update handler.go
  Bug in Shell Scripts (#373)
  Return empty list, if there is no challenges
  fixing issue that caused build fail
  more shell corrections
  Added M1 support to docker files (#351)
  updated shell files according to shellchecks (github.com/koalaman/shellcheck)
  readme fixes
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants