-
Notifications
You must be signed in to change notification settings - Fork 687
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate build tools in to
./tools/src/
, Telepresence-style
Signed-off-by: Luke Shumaker <[email protected]>
- Loading branch information
Showing
55 changed files
with
227 additions
and
372 deletions.
There are no files selected for viewing
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
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
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
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,6 @@ | |
# - Target: : $(NAME).docker # build untagged image; define this for each image $(NAME) | ||
## Outputs ## | ||
# | ||
# - Executable : WRITE_DOCKERTAGFILE ?= $(CURDIR)/build-aux/bin/write-dockertagfile | ||
# | ||
# - Variable : HAVE_DOCKER # non-empty if true, empty if false | ||
# - Variable : docker.LOCALHOST # "host.docker.internal" on Docker for Desktop, "localhost" on Docker CE | ||
# | ||
|
@@ -46,16 +44,16 @@ | |
# | ||
# The simplest version of that is: | ||
# | ||
# IMAGE.docker: $(MOVE_IFCHANGED) FORCE | ||
# IMAGE.docker: $(tools/move-ifchanged) FORCE | ||
# docker build [email protected] . | ||
# $(MOVE_IFCHANGED) [email protected] $@ | ||
# $(tools/move-ifchanged) [email protected] $@ | ||
# | ||
# If you have multiple `Dockerfile` at `IMAGE/Dockerfile`, you | ||
# might write a pattern rule: | ||
# | ||
# %.docker: %/Dockerfile $(MOVE_IFCHANGED) FORCE | ||
# %.docker: %/Dockerfile $(tools/move-ifchanged) FORCE | ||
# docker build [email protected] $* | ||
# $(MOVE_IFCHANGED) [email protected] $@ | ||
# $(tools/move-ifchanged) [email protected] $@ | ||
# | ||
# Unless you have a good reason to, you shouldn't concern yourself | ||
# with tagging the image in this rule. | ||
|
@@ -149,9 +147,9 @@ | |
# `--build-arg=` or `-f`: | ||
# | ||
# # Set a custom --build-arg, and use a funny Dockerfile name | ||
# myimage.docker: $(MOVE_IFCHANGED) FORCE | ||
# myimage.docker: $(tools/move-ifchanged) FORCE | ||
# docker build --iidfile=$(@D)/.tmp.$(@F).tmp --build-arg=FOO=BAR -f Dockerfile.myimage . | ||
# $(MOVE_IFCHANGED) $(@D)/.tmp.$(@F).tmp $@ | ||
# $(tools/move-ifchanged) $(@D)/.tmp.$(@F).tmp $@ | ||
# | ||
# 2. In `ambassador.git`, building the Envoy binary is slow, so we | ||
# might want to try pulling it from a build-cache Docker | ||
|
@@ -160,22 +158,22 @@ | |
# # Building this is expensive, so try grabbing a cached | ||
# # version before trying to build it. This goes ahead and | ||
# # tags the image, for caching purposes. | ||
# base-envoy.docker: $(WRITE_IFCHANGED) $(var.)BASE_ENVOY_IMAGE_CACHE | ||
# base-envoy.docker: $(tools/write-ifchanged) $(var.)BASE_ENVOY_IMAGE_CACHE | ||
# if ! docker run --rm --entrypoint=true $(BASE_ENVOY_IMAGE_CACHE); then \ | ||
# $(MAKE) envoy-bin/envoy-static-stripped | ||
# docker build -t $(BASE_ENVOY_IMAGE_CACHE) -f Dockerfile.base-envoy; \ | ||
# fi | ||
# docker image inspect $(BASE_ENVOY_IMAGE_CACHE) --format='{{.Id}}' | $(WRITE_IFCHANGED) $@ | ||
# docker image inspect $(BASE_ENVOY_IMAGE_CACHE) --format='{{.Id}}' | $(tools/write-ifchanged) $@ | ||
# | ||
# 3. In `apro.git`, we have many Docker images to build; each with | ||
# a Dockerfile at `docker/NAME/Dockerfile`. We accomplish this | ||
# with a simple pattern rule only slightly more complex than | ||
# the one given in the "Building" section: | ||
# | ||
# %.docker: %/Dockerfile $(MOVE_IFCHANGED) FORCE | ||
# %.docker: %/Dockerfile $(tools/move-ifchanged) FORCE | ||
# # Try with --pull, fall back to without --pull | ||
# docker build --iidfile=$(@D)/.tmp.$(@F).tmp --pull $* || docker build --iidfile=$(@D)/.tmp.$(@F).tmp $* | ||
# $(MOVE_IFCHANGED) $(@D)/.tmp.$(@F).tmp $@ | ||
# $(tools/move-ifchanged) $(@D)/.tmp.$(@F).tmp $@ | ||
# | ||
# The `--pull` is a good way to ensure that we incorporate any | ||
# patches to the base images that we build ours FROM. However, | ||
|
@@ -211,11 +209,6 @@ _docker.tag.groups = $(patsubst docker.tag.%,%,$(filter docker.tag.%,$(.VARIABLE | |
# clean.groups is separate from tag.groups as a special-case for docker-cluster.mk | ||
_docker.clean.groups += $(_docker.tag.groups) | ||
|
||
# | ||
# Executables | ||
|
||
WRITE_DOCKERTAGFILE ?= $(build-aux.bindir)/write-dockertagfile | ||
|
||
# | ||
# Output variables | ||
|
||
|
@@ -242,9 +235,9 @@ define _docker.tag.rule | |
# line 2: tag 1 | ||
# line 3: tag 2 | ||
# ... | ||
%.docker.tag.$(_docker.tag.group): %.docker $$(WRITE_DOCKERTAGFILE) FORCE | ||
%.docker.tag.$(_docker.tag.group): %.docker $$(tools/write-dockertagfile) FORCE | ||
# The 'foreach' is to handle newlines as normal whitespace | ||
printf '%s\n' $$$$(cat $$<) $$(foreach v,$$(docker.tag.$(_docker.tag.group)),$$v) | $$(WRITE_DOCKERTAGFILE) $$@ | ||
printf '%s\n' $$$$(cat $$<) $$(foreach v,$$(docker.tag.$(_docker.tag.group)),$$v) | $$(tools/write-dockertagfile) $$@ | ||
|
||
# file contents: | ||
# line 1: image ID | ||
|
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
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
Oops, something went wrong.