2019-03-09 01:12:03 +00:00
|
|
|
DOCKER_TAG ?= multiarch-test-${USER}
|
|
|
|
|
|
|
|
.PHONY: default
|
|
|
|
default: test
|
|
|
|
|
|
|
|
.PHONY:test
|
|
|
|
test:
|
|
|
|
@echo ok
|
|
|
|
|
2019-06-05 00:18:25 +00:00
|
|
|
# Build Docker image for host architechture (amd64)
|
|
|
|
.PHONY: build
|
2020-01-30 19:54:40 +00:00
|
|
|
build:
|
2019-06-05 00:18:25 +00:00
|
|
|
docker build . -t ${DOCKER_TAG}-linux-amd64
|
2019-03-09 01:12:03 +00:00
|
|
|
|
2019-06-05 00:18:25 +00:00
|
|
|
# Cross build for arm architechtures
|
2019-03-09 01:12:03 +00:00
|
|
|
.PHONY: cross-build-arm
|
2020-01-30 19:54:40 +00:00
|
|
|
cross-build-arm:
|
2019-06-05 00:18:25 +00:00
|
|
|
docker build --build-arg REPO=arm32v6 --build-arg ARCH=arm . -t ${DOCKER_TAG}-linux-arm
|
|
|
|
|
|
|
|
.PHONY: cross-build-arm
|
2020-01-30 19:54:40 +00:00
|
|
|
cross-build-arm64:
|
2019-06-05 00:18:25 +00:00
|
|
|
docker build --build-arg REPO=arm64v8 --build-arg ARCH=aarch64 . -t ${DOCKER_TAG}-linux-arm64
|
2019-03-09 01:12:03 +00:00
|
|
|
|
2019-06-05 00:18:25 +00:00
|
|
|
# Run on host architechture
|
2019-03-09 01:12:03 +00:00
|
|
|
.PHONY: run
|
|
|
|
run: build
|
2019-06-05 00:18:25 +00:00
|
|
|
docker run ${DOCKER_TAG}-linux-amd64
|
2019-03-09 01:12:03 +00:00
|
|
|
|
2019-06-05 00:18:25 +00:00
|
|
|
# Cross run on host architechture
|
|
|
|
.PHONY: cross-run-arm
|
2019-03-09 01:12:03 +00:00
|
|
|
cross-run-arm: cross-build-arm
|
2019-06-05 00:18:25 +00:00
|
|
|
docker run --rm ${DOCKER_TAG}-linux-arm
|
|
|
|
|
|
|
|
.PHONY: cross-run-arm64
|
|
|
|
cross-run-arm64: cross-build-arm64
|
|
|
|
docker run --rm ${DOCKER_TAG}-linux-arm64
|