Created
November 6, 2019 13:15
-
-
Save kaihendry/d4c90582aec6da1bb648a2bed84bb36d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NAME := hendry/sla | |
VERSION = $(shell git describe --tags --always --dirty) | |
BRANCH = $(shell git rev-parse --abbrev-ref HEAD) | |
DATE = $(shell date +'%FT%T%z') | |
manifest: options amd64 arm | |
docker manifest create --amend $(NAME):$(VERSION) $(NAME):amd64 $(NAME):arm | |
docker manifest annotate $(NAME):$(VERSION) $(NAME):arm --os linux --arch arm | |
docker manifest inspect $(NAME):$(VERSION) | |
docker manifest push -p $(NAME):$(VERSION) | |
# $(NAME):latest | |
docker manifest create --amend $(NAME) $(NAME):amd64 $(NAME):arm | |
docker manifest annotate $(NAME) $(NAME):arm --os linux --arch arm | |
docker manifest inspect $(NAME) | |
docker manifest push -p $(NAME) | |
amd64: common TARGET_ARCH=$@ | |
arm: common TARGET_ARCH=$@ | |
common: | |
echo docker build -t $(NAME):$(TARGET_ARCH) . \ | |
--build-arg TARGET_ARCH=$(TARGET_ARCH) \ | |
--build-arg VERSION=$(VERSION) \ | |
--build-arg BRANCH=$(BRANCH) \ | |
--build-arg USER=$(USER) \ | |
--build-arg BUILDDATE=$(DATE) \ | |
--build-arg HOST=$(HOSTNAME) | |
# docker push $(NAME):$@ | |
options: | |
@echo sla build options: | |
@echo "VERSION = ${VERSION}" | |
@echo "BRANCH = ${BRANCH}" | |
@echo "DATE = ${DATE}" | |
run: | |
docker run -p 8080:8080 -p 8081:8081 $(NAME) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment