-
Notifications
You must be signed in to change notification settings - Fork 14
/
docker.mk
46 lines (37 loc) · 1.21 KB
/
docker.mk
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
40
41
42
43
44
45
46
# Managed by makego. DO NOT EDIT.
# Must be set
$(call _assert_var,MAKEGO)
$(call _conditional_include,$(MAKEGO)/base.mk)
# Must be set
$(call _assert_var,PROJECT)
# Must be set
$(call _assert_var,GO_MODULE)
# Must be set
$(call _assert_var,DOCKER_ORG)
# Must be set
$(call _assert_var,DOCKER_PROJECT)
# Settable
DOCKER_BINS ?=
# Settable
DOCKER_BUILD_EXTRA_FLAGS ?=
.PHONY: dockerbuild
dockerbuild::
define dockerbinfunc
.PHONY: dockerbuilddeps$(1)
dockerbuilddeps$(1)::
.PHONY: dockerbuild$(1)
dockerbuild$(1): dockerbuilddeps$(1)
docker build $(DOCKER_BUILD_EXTRA_FLAGS) -t $(DOCKER_ORG)/$(1):latest -f Dockerfile.$(1) .
ifdef EXTRA_DOCKER_ORG
docker tag $(DOCKER_ORG)/$(1):latest $(EXTRA_DOCKER_ORG)/$(1):latest
endif
dockerbuild:: dockerbuild$(1)
endef
$(foreach dockerbin,$(sort $(DOCKER_BINS)),$(eval $(call dockerbinfunc,$(dockerbin))))
.PHONY: updatedockerignores
updatedockerignores:
@rm -f .dockerignore
@echo '# Autogenerated by makego. DO NOT EDIT.' > .dockerignore
@$(foreach file_ignore,$(sort $(FILE_IGNORES)),echo $(file_ignore) >> .dockerignore || exit 1;)
@$(foreach docker_file_ignore,$(sort $(DOCKER_FILE_IGNORES)),echo $(docker_file_ignore) >> .dockerignore || exit 1;)
pregenerate:: updatedockerignores