multiarch-pipeline-test/Makefile

37 lines
845 B
Makefile
Raw Permalink Normal View History

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