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

feat: add multi-arch Dockerfiles and scripts #1712

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

vpavlin
Copy link
Member

@vpavlin vpavlin commented May 3, 2023

Description

Adding Dockerfiles and Makefile targets to build static binaries for amd64 and arm64, produce archives with those binaries and build minimal docker images.

It uses pre-built container images to ensure stable build environment - DFs and build script are located in ./docker/base/

To build the binary it mounts current working directory (nwaku repo) and then remounts vendor and build with architecture specific folders to avoid conflicts (e.g. when building arm64, dependencies will be cloned into vendor-arm64 and result will be located in build/arm64/)

EDIT: There are targets for packing up the binaries (make dist-$(ARCH)) and building final container images (make dist-container-$(ARCH))

I've also added an experimental make release-notes which uses sv4git to generate changelog/release notes based on semantic commit messages

Missing

  • Final container images naming
  • Final registry/repository for builder images
  • MacOS build

Changes

No changes to existing code, only additions for now

How to test

If you want to run everything, you can execute

make -j$(nproc) dist-container

It will

  1. build static binaries for both amd64 and arm64
  2. create artifact tarballs in dist/ folder
  3. build arm64 and amd64 container images with the static binaries

Keep in mind that compiling for arm64 on non-arm hardware takes significantly longer than building amd64 on amd64

@vpavlin vpavlin force-pushed the feat/multi-arch branch 3 times, most recently from 53310f6 to 204c047 Compare May 12, 2023 11:07
@vpavlin vpavlin force-pushed the feat/multi-arch branch from 204c047 to 18a57eb Compare May 12, 2023 11:12
@vpavlin vpavlin changed the title [WIP] feat: add multi-arch Dockerfiles and scripts feat: add multi-arch Dockerfiles and scripts May 12, 2023
@vpavlin vpavlin force-pushed the feat/multi-arch branch 7 times, most recently from 1975d20 to f95f944 Compare May 12, 2023 16:31
@vpavlin vpavlin force-pushed the feat/multi-arch branch from f95f944 to c84ae74 Compare May 15, 2023 11:22
@vpavlin vpavlin mentioned this pull request May 16, 2023
1 task
@vpavlin vpavlin marked this pull request as draft May 22, 2023 08:23
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.

1 participant