From 4bff6eb71c7efdcb81b257244a674127d2aa7e34 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Wed, 13 Sep 2023 15:50:23 -0700 Subject: [PATCH] Add versions to the docker files Now that we have versions working more consistently, add them to the docker files. This is primarily motivated by distinguishing openssl versions in the docker images saved on a repository. Signed-off-by: Mic Bowman --- docker/Makefile | 12 +++++++++--- docker/pdo_ccf.dockerfile | 3 ++- docker/pdo_client.dockerfile | 3 ++- docker/pdo_services.dockerfile | 3 ++- docker/pdo_services_base.dockerfile | 3 ++- docker/test.yaml | 3 +++ 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/docker/Makefile b/docker/Makefile index 0b275c45..0bd47982 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -56,11 +56,16 @@ TIMESTAMP := $(shell /bin/date "+%Y%m%d%H%M%S") all : $(addprefix build_,$(IMAGES)) rebuild_% : repository - @ docker build $(DOCKER_ARGS) --build-arg REBUILD=$(TIMESTAMP) --tag pdo_$* \ + @ docker build $(DOCKER_ARGS) \ + --build-arg REBUILD=$(TIMESTAMP) \ + --build-arg PDO_VERSION=$(shell cd repository; bin/get_version) \ + --tag pdo_$*:$(shell cd repository; bin/get_version) \ --file $(SCRIPT_DIR)/pdo_$*.dockerfile . build_% : repository - @ docker build $(DOCKER_ARGS) --tag pdo_$* \ + @ docker build $(DOCKER_ARGS) \ + --build-arg PDO_VERSION=$(shell cd repository; bin/get_version) \ + --tag pdo_$*:$(shell cd repository; bin/get_version) \ --file $(SCRIPT_DIR)/pdo_$*.dockerfile . clean_% : @@ -106,7 +111,8 @@ TEST_FILES += -f test.yaml build_test : repository PDO_USER_UID=$(PDO_USER_UID) PDO_GROUP_UID=$(PDO_GROUP_UID) \ - docker-compose $(TEST_FILES) build + docker-compose $(TEST_FILES) build \ + --build-arg PDO_VERSION=$(shell cd repository; bin/get_version) test : clean_config clean_repository build_base build_services_base build_ccf_base build_test docker-compose $(TEST_FILES) up --abort-on-container-exit diff --git a/docker/pdo_ccf.dockerfile b/docker/pdo_ccf.dockerfile index fc021a50..6a1ee6b2 100644 --- a/docker/pdo_ccf.dockerfile +++ b/docker/pdo_ccf.dockerfile @@ -14,7 +14,8 @@ # limitations under the License. # ------------------------------------------------------------------------------ -FROM pdo_ccf_base +ARG PDO_VERSION +FROM pdo_ccf_base:${PDO_VERSION} # ----------------------------------------------------------------- # set up the PDO sources diff --git a/docker/pdo_client.dockerfile b/docker/pdo_client.dockerfile index 84c1f75d..53b68d22 100644 --- a/docker/pdo_client.dockerfile +++ b/docker/pdo_client.dockerfile @@ -14,7 +14,8 @@ # limitations under the License. # ------------------------------------------------------------------------------ -FROM pdo_base +ARG PDO_VERSION +FROM pdo_base:${PDO_VERSION} # ----------------------------------------------------------------- # ----------------------------------------------------------------- diff --git a/docker/pdo_services.dockerfile b/docker/pdo_services.dockerfile index d6413066..f92ef95f 100644 --- a/docker/pdo_services.dockerfile +++ b/docker/pdo_services.dockerfile @@ -14,7 +14,8 @@ # limitations under the License. # ------------------------------------------------------------------------------ -FROM pdo_services_base +ARG PDO_VERSION +FROM pdo_services_base:${PDO_VERSION} # ----------------------------------------------------------------- # set up the PDO sources diff --git a/docker/pdo_services_base.dockerfile b/docker/pdo_services_base.dockerfile index 22fbef94..87794850 100644 --- a/docker/pdo_services_base.dockerfile +++ b/docker/pdo_services_base.dockerfile @@ -14,7 +14,8 @@ # limitations under the License. # ------------------------------------------------------------------------------ -FROM pdo_base +ARG PDO_VERSION +FROM pdo_base:${PDO_VERSION} ARG UBUNTU_VERSION=20.04 ARG UBUNTU_NAME=focal diff --git a/docker/test.yaml b/docker/test.yaml index e36e7fb4..6450d6b3 100644 --- a/docker/test.yaml +++ b/docker/test.yaml @@ -18,6 +18,7 @@ services: ccf_container: build: args: + PDO_VERSION: ${PDO_VERSION} PDO_HOSTNAME: localhost PDO_LEDGER_URL: http://localhost:6600 entrypoint: /project/pdo/tools/run_ccf_tests.sh @@ -25,6 +26,7 @@ services: services_container: build: args: + PDO_VERSION: ${PDO_VERSION} PDO_HOSTNAME: localhost PDO_LEDGER_URL: http://localhost:6600 entrypoint: /project/pdo/tools/run_services_tests.sh @@ -32,6 +34,7 @@ services: client_container: build: args: + PDO_VERSION: ${PDO_VERSION} PDO_HOSTNAME: localhost PDO_LEDGER_URL: http://localhost:6600 entrypoint: /project/pdo/tools/run_client_tests.sh