diff --git a/docker/Makefile b/docker/Makefile index 9264aab9..45a9e44c 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 0a47a00b..c8bb7f17 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 a3deab47..73710765 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 111e6305..54dba179 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 cbb71d0a..8eab36f8 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 PDO_LOG_LEVEL: ${PDO_LOG_LEVEL:-info} @@ -34,6 +36,7 @@ services: client_container: build: args: + PDO_VERSION: ${PDO_VERSION} PDO_HOSTNAME: localhost PDO_LEDGER_URL: http://localhost:6600 PDO_LOG_LEVEL: ${PDO_LOG_LEVEL:-info}