Skip to content

Commit

Permalink
build: Pre-pull FROM images with DOCKER_BUIDKIT
Browse files Browse the repository at this point in the history
[ upstream commit ae5d7c1 ]

Docker buildkit often fails to actaully pull the FROM image and then
fails wit errors like:

 > [builder 4/4] RUN make ... clean-container build-container install-container:
#13 0.344 /bin/sh: 1: make: not found

Fix this by pulling all FROM images before docker build. This depends
on the FROM image names not be based on build ARGs, which is the case
for all the current Dockerfiles in the repo.

Fixes: #11513
Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
Signed-off-by: André Martins <andre@cilium.io>
  • Loading branch information
jrajahalme authored and aanm committed Jun 22, 2020
1 parent bdc445b commit 36fcb65
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Makefile.buildkit
Expand Up @@ -64,6 +64,7 @@ _build/context/BPF_SRCFILES: BPF_SRCFILES _build/context
_build/%ockerfile: %ockerfile force
@-mkdir -p $(dir $@)
@cat $< $(BUILDKIT_DOCKERFILE_FILTER) > $@
@-grep "^FROM " $@ | cut -d ' ' -f2 | grep -v "scratch" | xargs -P4 -n1 docker pull

check-status:
@if [ -n "`git status --porcelain`" ] ; then git status && echo "These changes will not be included in build, aborting. Define IGNORE_GIT_STATUS to build anyway." && test $(IGNORE_GIT_STATUS); fi
Expand Down

0 comments on commit 36fcb65

Please sign in to comment.