[XEN PATCH] automation: Always pull base image when building a container

Anthony PERARD posted 1 patch 1 year, 2 months ago
Test gitlab-ci passed
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20230228182226.52201-1-anthony.perard@citrix.com
automation/build/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[XEN PATCH] automation: Always pull base image when building a container
Posted by Anthony PERARD 1 year, 2 months ago
Ask docker to check if there's an update of the base image to avoid
using an old container cached locally.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 automation/build/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/build/Makefile b/automation/build/Makefile
index f1d56ce532..4df43b0407 100644
--- a/automation/build/Makefile
+++ b/automation/build/Makefile
@@ -16,7 +16,7 @@ help:
 include yocto/yocto.inc
 
 %: %.dockerfile ## Builds containers
-	$(DOCKER_CMD) build -t $(REGISTRY)/$(@D):$(@F) -f $< $(<D)
+	$(DOCKER_CMD) build --pull -t $(REGISTRY)/$(@D):$(@F) -f $< $(<D)
 	@if [ ! -z $${PUSH+x} ]; then \
 		$(DOCKER_CMD) push $(REGISTRY)/$(@D):$(@F); \
 	fi
-- 
Anthony PERARD
Re: [XEN PATCH] automation: Always pull base image when building a container
Posted by Stefano Stabellini 1 year, 2 months ago
On Tue, 28 Feb 2023, Anthony PERARD wrote:
> Ask docker to check if there's an update of the base image to avoid
> using an old container cached locally.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

> ---
>  automation/build/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/automation/build/Makefile b/automation/build/Makefile
> index f1d56ce532..4df43b0407 100644
> --- a/automation/build/Makefile
> +++ b/automation/build/Makefile
> @@ -16,7 +16,7 @@ help:
>  include yocto/yocto.inc
>  
>  %: %.dockerfile ## Builds containers
> -	$(DOCKER_CMD) build -t $(REGISTRY)/$(@D):$(@F) -f $< $(<D)
> +	$(DOCKER_CMD) build --pull -t $(REGISTRY)/$(@D):$(@F) -f $< $(<D)
>  	@if [ ! -z $${PUSH+x} ]; then \
>  		$(DOCKER_CMD) push $(REGISTRY)/$(@D):$(@F); \
>  	fi
> -- 
> Anthony PERARD
>
Re: [XEN PATCH] automation: Always pull base image when building a container
Posted by Andrew Cooper 1 year, 2 months ago
On 28/02/2023 6:22 pm, Anthony PERARD wrote:
> Ask docker to check if there's an update of the base image to avoid
> using an old container cached locally.
>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

I've lost count of how many times I've fallen over this.