forked from patrickhoefler/dockerfilegraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
28 lines (21 loc) · 1.04 KB
/
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
GITVERSION := $(shell git describe --tags --always)
GITCOMMIT := $(shell git log -1 --pretty=format:"%H")
BUILDDATE := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
LDFLAGS += -s -w
LDFLAGS += -X github.com/patrickhoefler/dockerfilegraph/internal/cmd.gitVersion=$(GITVERSION)
LDFLAGS += -X github.com/patrickhoefler/dockerfilegraph/internal/cmd.gitCommit=$(GITCOMMIT)
LDFLAGS += -X github.com/patrickhoefler/dockerfilegraph/internal/cmd.buildDate=$(BUILDDATE)
FLAGS = -ldflags "$(LDFLAGS)"
build:
go build $(FLAGS)
build-linux-amd64:
GOOS=linux GOARCH=amd64 go build $(FLAGS)
example-images:
# Change to the root directory of the project.
cd $(git rev-parse --show-toplevel)
go run . -f examples/dockerfiles/Dockerfile --legend -o svg \
&& mv Dockerfile.svg examples/images/Dockerfile-legend.svg
go run . -f examples/dockerfiles/Dockerfile --layers -o svg \
&& mv Dockerfile.svg examples/images/Dockerfile-layers.svg
go run . -f examples/dockerfiles/Dockerfile.large -c -n 0.3 -o svg -u 4 \
&& mv Dockerfile.svg examples/images/Dockerfile-large.svg