Skip to content

Commit e409e7d

Browse files
Merge pull request #20720 from bparees/local
always pull image before rebuilding local images
2 parents 7e70dc8 + cba82a9 commit e409e7d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hack/build-local-images.py

+3
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@ def debug(message):
257257
)
258258

259259
debug("Initiating Docker build with Dockerfile:\n{}".format(open(join(context_dir, "Dockerfile")).read()))
260+
# re-pull the original image before building it so we're not accumulating layers each time we
261+
# rebuild the image.
262+
call(["docker", "pull", full_name(image) + ":" + image_config[image]["tag"]])
260263
call(["docker", "build", "-t", full_name(image), "."], cwd=context_dir)
261264

262265
remove(join(context_dir, "Dockerfile"))

0 commit comments

Comments
 (0)