Skip to contentSkip to conversation

docker: Be compatible with older docker

PATCH In review Fam Zheng 2 participants 3 messages Aug 3, 2016 – Aug 4, 2016

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH 1/1 docker: Be compatible with older docker

By not using "--format" with docker images command.

The option is not available on RHEL 7 docker command. Use an awk matching command instead.

---
 tests/docker/Makefile.include | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
tests/docker/Makefile.include +2 -3
index 78af468..4f4707d 100644
@@ -107,9 +107,8 @@ docker-run-%: docker-qemu-src
 	fi
 	$(if $(filter $(TESTS),$(CMD)),$(if $(filter $(IMAGES),$(IMAGE)), \
 		$(call quiet-command,\
-			if $(SRC_PATH)/tests/docker/docker.py images \
-				--format={{.Repository}}:{{.Tag}} | \
-					grep -qx qemu:$(IMAGE); then \
+			if $(SRC_PATH)/tests/docker/docker.py images | \
+				awk '$$1=="qemu" && $$2=="$(IMAGE)"{found=1} END{exit(!found)}'; then \
 				$(SRC_PATH)/tests/docker/docker.py run $(if $V,,--rm) \
 				-t \
 				$(if $(DEBUG),-i,--net=none) \
Signature · 1 line
2.7.4
author
#1 lore raw
Quoted 31 lines · Fam Zheng

By not using "--format" with docker images command.

The option is not available on RHEL 7 docker command. Use an awk matching command instead.

---
 tests/docker/Makefile.include | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
tests/docker/Makefile.include +2 -3
index 78af468..4f4707d 100644
@@ -107,9 +107,8 @@ docker-run-%: docker-qemu-src
 	fi
 	$(if $(filter $(TESTS),$(CMD)),$(if $(filter $(IMAGES),$(IMAGE)), \
 		$(call quiet-command,\
-			if $(SRC_PATH)/tests/docker/docker.py images \
-				--format={{.Repository}}:{{.Tag}} | \
-					grep -qx qemu:$(IMAGE); then \
+			if $(SRC_PATH)/tests/docker/docker.py images | \
+				awk '$$1=="qemu" && $$2=="$(IMAGE)"{found=1} END{exit(!found)}'; then \
 				$(SRC_PATH)/tests/docker/docker.py run $(if $V,,--rm) \
 				-t \
 				$(if $(DEBUG),-i,--net=none) \
Signature · 1 line
2.7.4

Paolo, does this work for you?

Fam

#2 lore raw
Quoted 6 lines · Fam Zheng
Quoted 5 lines · Fam Zheng

By not using "--format" with docker images command.

The option is not available on RHEL 7 docker command. Use an awk matching command instead.

Quoted 7 lines
Quoted 5 lines
---
 tests/docker/Makefile.include | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Paolo, does this work for you?

Yes, it works. Thanks!

Paolo