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

chore: update build args to arm64 #157

Merged
merged 7 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Build, CI
(ci) [\#145](https://github.com/line/lbm/pull/145) add github action to push docker image to docker.io
(build) [\#157](https://github.com/line/finschia/pull/157) add build args

### Docs
* (doc) [\#156](https://github.com/line/finschia/pull/156) modify broken link or typo doc file and add issue and pr template
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ BUILDDIR ?= $(CURDIR)/build
TEST_DOCKER_REPO=jackzampolin/linktest
CGO_ENABLED ?= 1
ARCH ?= x86_64
TARGET_PLATFORM ?= linux/amd64

export GO111MODULE = on

ifeq ($(ARCH), aarch64)
TARGET_PLATFORM=linux/arm64
endif

# process build tags

build_tags = netgo
Expand Down Expand Up @@ -160,7 +165,7 @@ build: go.sum $(BUILDDIR)/ dbbackend $(LIBSODIUM_TARGET)
CGO_CFLAGS=$(CGO_CFLAGS) CGO_LDFLAGS=$(CGO_LDFLAGS) CGO_ENABLED=$(CGO_ENABLED) go build -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./...

build-static: go.sum $(BUILDDIR)/
docker build -t line/finschianode:latest -f builders/Dockerfile.static . --build-arg ARCH=$(ARCH) --platform="linux/amd64"
docker build -t line/finschianode:latest -f builders/Dockerfile.static . --build-arg ARCH=$(ARCH) --platform="$(TARGET_PLATFORM)"

build-static-centos7: go.sum $(BUILDDIR)/
docker build -t line/finschia-builder:static_centos7 -f builders/Dockerfile.static_centos7 .
Expand Down Expand Up @@ -232,7 +237,7 @@ dbbackend:
endif

build-docker:
docker build --build-arg FINSCHIA_BUILD_OPTIONS="$(FINSCHIA_BUILD_OPTIONS)" -t line/lbm .
docker build --build-arg FINSCHIA_BUILD_OPTIONS="$(FINSCHIA_BUILD_OPTIONS)" --build-arg ARCH=$(ARCH) -t line/lbm . --platform="$(TARGET_PLATFORM)"

build-contract-tests-hooks:
mkdir -p $(BUILDDIR)
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ or
make build-docker WITH_CLEVELDB=yes GITHUB_TOKEN=${YOUR_GITHUB_TOKEN} # build docker image with cleveldb
```

_Note1_

If you are using M1 mac, you need to specify build args like this:
```
make build-docker ARCH=aarch64
```

**Configure**
```
sh init_single.sh docker # prepare keys, validators, initial state, etc.
Expand Down