From 721c2e616ecaa68fc3e698ae470040f13feb6adf Mon Sep 17 00:00:00 2001 From: Arthur Barr Date: Thu, 26 Oct 2017 13:27:26 +0100 Subject: [PATCH] Add image labels dynamically --- Dockerfile-server | 14 ++++---------- Makefile | 6 +++--- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Dockerfile-server b/Dockerfile-server index 985a890..43fccd9 100644 --- a/Dockerfile-server +++ b/Dockerfile-server @@ -14,10 +14,6 @@ FROM ubuntu:16.04 -ARG IBM_PRODUCT_ID -ARG IBM_PRODUCT_NAME -ARG IBM_PRODUCT_VERSION - # The URL to download the MQ installer from in tar.gz format # This assumes an archive containing the MQ Debian (.deb) install packages ARG MQ_URL @@ -25,14 +21,12 @@ ARG MQ_URL # The MQ packages to install ARG MQ_PACKAGES="ibmmq-server ibmmq-java ibmmq-jre ibmmq-gskit ibmmq-msg-.* ibmmq-samples ibmmq-ams" -LABEL "ProductID"=$IBM_PRODUCT_ID \ - "ProductName"=$IBM_PRODUCT_NAME \ - "ProductVersion"=$IBM_PRODUCT_VERSION - COPY install-mq.sh /usr/local/bin/ + +# Install MQ. To avoid a "text file busy" error here, we sleep before installing. RUN chmod u+x /usr/local/bin/install-mq.sh \ -# To avoid a "text file busy" error here we sleep before installing. - && sleep 1 && install-mq.sh + && sleep 1 \ + && install-mq.sh COPY build/runmqserver /usr/local/bin/ COPY build/chkmq* /usr/local/bin/ diff --git a/Makefile b/Makefile index edb1e77..8111f47 100644 --- a/Makefile +++ b/Makefile @@ -126,9 +126,9 @@ define docker-build-mq --file $2 \ --network build \ --build-arg MQ_URL=http://build:80/$3 \ - --build-arg IBM_PRODUCT_ID=$4 \ - --build-arg IBM_PRODUCT_NAME=$5 \ - --build-arg IBM_PRODUCT_VERSION=$6 \ + --label IBM_PRODUCT_ID=$4 \ + --label IBM_PRODUCT_NAME=$5 \ + --label IBM_PRODUCT_VERSION=$6 \ . # Stop the web server (will also remove the container) $(DOCKER) kill $(BUILD_SERVER_CONTAINER)