|
1 | 1 | REGISTRY := ghcr.io/logsem/iris-tutorial |
2 | | -OCAML_VER := 5.5 |
3 | | -MODE ?= stable |
4 | | - |
5 | | -# Logic for Base Image and Tags |
6 | | -ifeq ($(MODE),unstable) |
7 | | - BASE_IMAGE := ocaml/opam:debian-unstable-ocaml-5.5 |
8 | | - IMAGE_NAME := debian-unstable-ocaml-$(OCAML_VER) |
9 | | -else |
10 | | - BASE_IMAGE := ocaml/opam:debian-ocaml-5.5 |
11 | | - IMAGE_NAME := debian-ocaml-$(OCAML_VER) |
12 | | -endif |
| 2 | +BASE_IMAGE := ocaml/opam:debian-12-ocaml-5.4 |
13 | 3 |
|
14 | 4 | default: |
15 | | - @echo 'Usage: make [stable-x86-64 | unstable-x86-64 | stable-arm64 | unstable-arm64]' |
16 | | - |
17 | | -# Internal build logic |
18 | | -build-%: |
19 | | - $(eval ARCH_RAW := $*) |
20 | | - $(eval PLATFORM := $(if $(filter x86-64,$(ARCH_RAW)),linux/amd64,linux/arm64)) |
21 | | - $(eval OPAM_ARCH := $(if $(filter x86-64,$(ARCH_RAW)),x86_64-linux,arm64-linux)) |
| 5 | + @echo 'Usage: make [x86-64 | arm64 | push-x86-64 | push-arm64]' |
22 | 6 |
|
23 | | - # We use -f to point to the Dockerfile because the context is now ".." |
| 7 | +x86-64: |
24 | 8 | docker build \ |
25 | | - --platform $(PLATFORM) \ |
| 9 | + --platform linux/amd64 \ |
| 10 | + --build-context repo=.. \ |
26 | 11 | --build-arg BASE_IMAGE=$(BASE_IMAGE) \ |
27 | | - --build-arg MODE=$(MODE) \ |
28 | | - -f Dockerfile \ |
29 | | - -t $(REGISTRY)/$(IMAGE_NAME)-$(ARCH_RAW) \ |
30 | | - .. |
31 | | - |
32 | | -# Public targets |
33 | | -stable-x86-64: |
34 | | - $(MAKE) build-x86-64 MODE=stable |
35 | | - |
36 | | -unstable-x86-64: |
37 | | - $(MAKE) build-x86-64 MODE=unstable |
38 | | - |
39 | | -stable-arm64: |
40 | | - $(MAKE) build-arm64 MODE=stable |
| 12 | + -t $(REGISTRY)/docker-x86-64 . |
41 | 13 |
|
42 | | -unstable-arm64: |
43 | | - $(MAKE) build-arm64 MODE=unstable |
44 | | - |
45 | | -# Push targets |
46 | | -push-stable-x86-64: stable-x86-64 |
47 | | - docker push $(REGISTRY)/debian-ocaml-$(OCAML_VER)-x86-64 |
48 | | - |
49 | | -push-unstable-x86-64: unstable-x86-64 |
50 | | - docker push $(REGISTRY)/debian-unstable-ocaml-$(OCAML_VER)-x86-64 |
| 14 | +arm64: |
| 15 | + docker build \ |
| 16 | + --platform linux/arm64 \ |
| 17 | + --build-context repo=.. \ |
| 18 | + --build-arg BASE_IMAGE=$(BASE_IMAGE) \ |
| 19 | + -t $(REGISTRY)/docker-arm64 . |
51 | 20 |
|
52 | | -push-stable-arm64: stable-arm64 |
53 | | - docker push $(REGISTRY)/debian-ocaml-$(OCAML_VER)-arm64 |
| 21 | +push-x86-64: x86-64 |
| 22 | + docker push $(REGISTRY)/docker-x86-64 |
54 | 23 |
|
55 | | -push-unstable-arm64: unstable-arm64 |
56 | | - docker push $(REGISTRY)/debian-unstable-ocaml-$(OCAML_VER)-arm64 |
| 24 | +push-arm64: arm64 |
| 25 | + docker push $(REGISTRY)/docker-arm64 |
57 | 26 |
|
58 | | -.PHONY: stable-x86-64 unstable-x86-64 stable-arm64 unstable-arm64 \ |
59 | | - push-stable-x86-64 push-unstable-x86-64 push-stable-arm64 push-unstable-arm64 \ |
60 | | - default |
| 27 | +.PHONY: x86-64 arm64 push-x86-64 push-arm64 default |
0 commit comments