forked from stellar/stellar-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
16 lines (14 loc) · 759 Bytes
/
Copy pathMakefile
File metadata and controls
16 lines (14 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
###
# Check if we need to prepend docker commands with sudo
SUDO := $(shell docker version >/dev/null 2>&1 || echo "sudo")
# If LABEL is not provided set default value
LABEL ?= $(shell git rev-parse --short HEAD)$(and $(shell git status -s),-dirty-$(shell id -u -n))
# If TAG is not provided set default value
TAG ?= stellar/stellar-docs:$(LABEL)
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
BUILD_DATE := $(shell date -u +%FT%TZ)
# the app label is used by the pipelines to prune docker dangling images on the jenkins build hosts
docker-build:
$(SUDO) docker build -m 8g --no-cache --pull --label app="stellar-docs" --label org.opencontainers.image.created="$(BUILD_DATE)" -t $(TAG) .
docker-push:
$(SUDO) docker push $(TAG)