Skip to contentSkip to conversation

automation: Always pull base image when building a container

PATCH In review Anthony PERARD 3 participants 3 messages Feb 28, 2023 – Mar 1, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 automation: Always pull base image when building a container

Ask docker to check if there's an update of the base image to avoid using an old container cached locally.

---
 automation/build/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
automation/build/Makefile +1 -1
index f1d56ce532..4df43b0407 100644
@@ -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
Signature · 1 line
Anthony PERARD
Reviewed-by on v1 1/1
#2 lore raw
In reply to Anthony PERARD
Quoted 4 lines · Anthony PERARD

Ask docker to check if there's an update of the base image to avoid using an old container cached locally.

Quoted 20 lines
---
 automation/build/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
automation/build/Makefile +1 -1
index f1d56ce532..4df43b0407 100644
@@ -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
Signature · 1 line
Anthony PERARD