-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile
39 lines (34 loc) · 900 Bytes
/
Makefile
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
UNAME_M = $(shell uname -m)
ARCH=
ifeq ($(UNAME_M), x86_64)
ARCH=amd64
else ifeq ($(UNAME_M), aarch64)
ARCH=arm64
else
ARCH=$(UNAME_M)
endif
ORG ?= rancher
TAG ?= v1.19.0
GO_VERSION ?= $(shell echo $(TAG) | sed -e "s/v\(.*\)b.*/\1/g")
.PHONY: image-build
image-build:
docker build \
--pull \
--build-arg GOLANG_VERSION=$(GO_VERSION) \
--tag $(ORG)/hardened-build-base:$(TAG) \
--tag $(ORG)/hardened-build-base:$(TAG)-$(ARCH) \
. \
-f Dockerfile \
.PHONY: image-push
image-push:
docker push $(ORG)/hardened-build-base:$(TAG)-$(ARCH)
.PHONY: image-manifest
image-manifest:
DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create --amend \
$(ORG)/hardened-build-base:$(TAG) \
$(ORG)/hardened-build-base:$(TAG)-$(ARCH)
DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push \
$(ORG)/hardened-build-base:$(TAG)
.PHONY: go-version
go-version:
@echo $(GO_VERSION)