blob: a7203d5d225b9d0b8324d9b0f7c09e4412788f77 [file] [log] [blame]
Giorgi Lekveishvili0ba5e402024-03-20 15:56:30 +04001repo_name ?= giolekva
2podman ?= docker
gio2446de02025-04-11 11:20:39 +04003docker_flags=--provenance=false --sbom=false
Giorgi Lekveishvili0ba5e402024-03-20 15:56:30 +04004ifeq ($(podman), podman)
gio55885142024-08-16 13:11:00 +04005manifest_dest=docker://docker.io/$(repo_name)/auth-proxy:latest
Giorgi Lekveishvili0ba5e402024-03-20 15:56:30 +04006endif
7
8clean:
9 rm -f server server_*
10
11build: clean
Giorgi Lekveishvilia09fad72024-03-21 15:24:35 +040012 /usr/local/go/bin/go build -o server *.go
Giorgi Lekveishvili0ba5e402024-03-20 15:56:30 +040013
14build_arm64: export CGO_ENABLED=0
15build_arm64: export GO111MODULE=on
16build_arm64: export GOOS=linux
17build_arm64: export GOARCH=arm64
18build_arm64:
Giorgi Lekveishvilia09fad72024-03-21 15:24:35 +040019 /usr/local/go/bin/go build -o server_arm64 *.go
Giorgi Lekveishvili0ba5e402024-03-20 15:56:30 +040020
21build_amd64: export CGO_ENABLED=0
22build_amd64: export GO111MODULE=on
23build_amd64: export GOOS=linux
24build_amd64: export GOARCH=amd64
25build_amd64:
Giorgi Lekveishvilia09fad72024-03-21 15:24:35 +040026 /usr/local/go/bin/go build -o server_amd64 *.go
Giorgi Lekveishvili0ba5e402024-03-20 15:56:30 +040027
28push_arm64: clean build_arm64
gio2446de02025-04-11 11:20:39 +040029 $(podman) build --platform linux/arm64 --tag=$(repo_name)/auth-proxy:arm64 $(docker_flags) .
Giorgi Lekveishvili0ba5e402024-03-20 15:56:30 +040030 $(podman) push $(repo_name)/auth-proxy:arm64
31
32push_amd64: clean build_amd64
gio2446de02025-04-11 11:20:39 +040033 $(podman) build --platform linux/amd64 --tag=$(repo_name)/auth-proxy:amd64 $(docker_flags) .
Giorgi Lekveishvili0ba5e402024-03-20 15:56:30 +040034 $(podman) push $(repo_name)/auth-proxy:amd64
35
36
37push: push_arm64 push_amd64
38 $(podman) manifest create $(repo_name)/auth-proxy:latest $(repo_name)/auth-proxy:arm64 $(repo_name)/auth-proxy:amd64
gio2446de02025-04-11 11:20:39 +040039 $(podman) manifest push --purge $(repo_name)/auth-proxy:latest $(manifest_dest)