-
Notifications
You must be signed in to change notification settings - Fork 1
/
intermediate-containers.mk
81 lines (75 loc) · 3.74 KB
/
intermediate-containers.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
BUILD_RUST_CROSSBUILD_VERSION = 0.0.7
BUILD_OPENCV_BASE_VERSION = 0.0.7
CROSS_VERSION = 0.1.16
#
#
# OPENCV: make and push the open cv intermediate images:
#
# To make all platforms: `make opencv-base`
# To make specific platforms: `BUILD_AMD64=1 BUILD_ARM32=0 BUILD_ARM64=1 make opencv`
#
#
.PHONY: opencv-base
opencv-base: opencv-base-build opencv-base-docker-per-arch
opencv-base-build: opencv-base-build-amd64 opencv-base-build-arm32 opencv-base-build-arm64
opencv-base-build-amd64:
ifeq (1, ${BUILD_AMD64})
docker build $(CACHE_OPTION) -f $(INTERMEDIATE_DOCKERFILE_DIR)/Dockerfile.opencvsharp-build . -t $(PREFIX)/opencvsharp-build:$(BUILD_OPENCV_BASE_VERSION)-$(AMD64_SUFFIX) --build-arg PLATFORM_TAG=3.1-buster-slim
endif
opencv-base-build-arm32:
ifeq (1, ${BUILD_ARM32})
docker build $(CACHE_OPTION) -f $(INTERMEDIATE_DOCKERFILE_DIR)/Dockerfile.opencvsharp-build . -t $(PREFIX)/opencvsharp-build:$(BUILD_OPENCV_BASE_VERSION)-$(ARM32V7_SUFFIX) --build-arg PLATFORM_TAG=3.1-buster-slim-$(ARM32V7_SUFFIX)
endif
opencv-base-build-arm64:
ifeq (1, ${BUILD_ARM64})
docker build $(CACHE_OPTION) -f $(INTERMEDIATE_DOCKERFILE_DIR)/Dockerfile.opencvsharp-build . -t $(PREFIX)/opencvsharp-build:$(BUILD_OPENCV_BASE_VERSION)-$(ARM64V8_SUFFIX) --build-arg PLATFORM_TAG=3.1-buster-slim-$(ARM64V8_SUFFIX)
endif
opencv-base-docker-per-arch: opencv-base-docker-per-arch-amd64 opencv-base-docker-per-arch-arm32 opencv-base-docker-per-arch-arm64
opencv-base-docker-per-arch-amd64:
ifeq (1, ${BUILD_AMD64})
docker push $(PREFIX)/opencvsharp-build:$(BUILD_OPENCV_BASE_VERSION)-$(AMD64_SUFFIX)
endif
opencv-base-docker-per-arch-arm32:
ifeq (1, ${BUILD_ARM32})
docker push $(PREFIX)/opencvsharp-build:$(BUILD_OPENCV_BASE_VERSION)-$(ARM32V7_SUFFIX)
endif
opencv-base-docker-per-arch-arm64:
ifeq (1, ${BUILD_ARM64})
docker push $(PREFIX)/opencvsharp-build:$(BUILD_OPENCV_BASE_VERSION)-$(ARM64V8_SUFFIX)
endif
#
#
# CROSS: make and push the intermediate images for the cross building Rust:
#
# To make all platforms: `make rust-crossbuild`
# To make specific platforms: `BUILD_AMD64=1 BUILD_ARM32=0 BUILD_ARM64=1 make rust-crossbuild`
#
#
.PHONY: rust-crossbuild
rust-crossbuild: rust-crossbuild-build rust-crossbuild-docker-per-arch
rust-crossbuild-build: rust-crossbuild-build-amd64 rust-crossbuild-build-arm32 rust-crossbuild-build-arm64
rust-crossbuild-build-amd64:
ifeq (1, $(BUILD_AMD64))
docker build $(CACHE_OPTION) -f $(INTERMEDIATE_DOCKERFILE_DIR)/Dockerfile.rust-crossbuild-$(AMD64_SUFFIX) . -t $(PREFIX)/rust-crossbuild:$(AMD64_TARGET)-$(CROSS_VERSION)-$(BUILD_RUST_CROSSBUILD_VERSION)
endif
rust-crossbuild-build-arm32:
ifeq (1, ${BUILD_ARM32})
docker build $(CACHE_OPTION) -f $(INTERMEDIATE_DOCKERFILE_DIR)/Dockerfile.rust-crossbuild-$(ARM32V7_SUFFIX) . -t $(PREFIX)/rust-crossbuild:$(ARM32V7_TARGET)-$(CROSS_VERSION)-$(BUILD_RUST_CROSSBUILD_VERSION)
endif
rust-crossbuild-build-arm64:
ifeq (1, ${BUILD_ARM64})
docker build $(CACHE_OPTION) -f $(INTERMEDIATE_DOCKERFILE_DIR)/Dockerfile.rust-crossbuild-$(ARM64V8_SUFFIX) . -t $(PREFIX)/rust-crossbuild:$(ARM64V8_TARGET)-$(CROSS_VERSION)-$(BUILD_RUST_CROSSBUILD_VERSION)
endif
rust-crossbuild-docker-per-arch: rust-crossbuild-docker-per-arch-amd64 rust-crossbuild-docker-per-arch-arm32 rust-crossbuild-docker-per-arch-arm64
rust-crossbuild-docker-per-arch-amd64:
ifeq (1, $(BUILD_AMD64))
docker push $(PREFIX)/rust-crossbuild:$(AMD64_TARGET)-$(CROSS_VERSION)-$(BUILD_RUST_CROSSBUILD_VERSION)
endif
rust-crossbuild-docker-per-arch-arm32:
ifeq (1, ${BUILD_ARM32})
docker push $(PREFIX)/rust-crossbuild:$(ARM32V7_TARGET)-$(CROSS_VERSION)-$(BUILD_RUST_CROSSBUILD_VERSION)
endif
rust-crossbuild-docker-per-arch-arm64:
ifeq (1, ${BUILD_ARM64})
docker push $(PREFIX)/rust-crossbuild:$(ARM64V8_TARGET)-$(CROSS_VERSION)-$(BUILD_RUST_CROSSBUILD_VERSION)
endif