diff options
author | Tamir Duberstein <tamird@google.com> | 2020-09-11 01:55:59 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-09-11 01:57:42 -0700 |
commit | 964447c8ce1ba4f3c7413e90069a045fe0877c2a (patch) | |
tree | f53c64671dc03479577ed8ad3dea08dbf0330307 /images/Makefile | |
parent | 365545855f7713236d77d3e263ad09ebffa85bb2 (diff) |
Clean up image construction
- Skip `docker inspect`; `docker pull` is idempotent
- Remove unnecessary CMD directives in Dockerfiles
- Run bazel before building images to catch errors sooner
PiperOrigin-RevId: 331107815
Diffstat (limited to 'images/Makefile')
-rw-r--r-- | images/Makefile | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/images/Makefile b/images/Makefile index d183155a8..d4b6524ba 100644 --- a/images/Makefile +++ b/images/Makefile @@ -61,7 +61,7 @@ local_image = $(LOCAL_IMAGE_PREFIX)/$(subst _,/,$(1)) # conflicting with the bazel "build" terminology, which is used elsewhere. rebuild-%: FROM=$(shell grep FROM $(call path,$*)/Dockerfile | cut -d' ' -f2) rebuild-%: register-cross - $(foreach IMAGE,$(FROM),docker pull $(DOCKER_PLATFORM_ARGS) $(IMAGE) &&) true && \ + $(foreach IMAGE,$(FROM),docker pull $(DOCKER_PLATFORM_ARGS) $(IMAGE) &&) \ T=$$(mktemp -d) && cp -a $(call path,$*)/* $$T && \ docker build $(DOCKER_PLATFORM_ARGS) -t $(call remote_image,$*) $$T && \ rm -rf $$T @@ -73,10 +73,10 @@ pull-%: docker pull $(DOCKER_PLATFORM_ARGS) $(call remote_image,$*) # load will either pull the "remote" or build it locally. This is the preferred -# entrypoint, as it should never file. The local tag should always be set after +# entrypoint, as it should never fail. The local tag should always be set after # this returns (either by the pull or the build). load-%: - docker inspect $(call remote_image,$*) >/dev/null 2>&1 || $(MAKE) pull-$* || $(MAKE) rebuild-$* + $(MAKE) pull-$* || $(MAKE) rebuild-$* docker tag $(call remote_image,$*) $(call local_image,$*) # push pushes the remote image, after either pulling (to validate that the tag |