From 96cfc9860bd9d5f8d8c2d7cb7bd20ea54bd6d5f8 Mon Sep 17 00:00:00 2001 From: Erich Cordoba Date: Fri, 5 Oct 2018 10:55:24 -0500 Subject: [PATCH] Enable multiple docker images per user. With this change, the docker image will be created using the MYUNAME variable set in the localrc file. Closes-Bug: 1796360 Change-Id: Ia82a3ac463d77b6f59b5ba7ab59ae7bbf3eba49c Signed-off-by: Erich Cordoba --- Makefile | 19 ++++++++++--------- tb.sh | 6 +++--- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 06a18ed9..ffe894c4 100644 --- a/Makefile +++ b/Makefile @@ -5,20 +5,21 @@ MY_TC_RELEASE := tis-r5-pike UID := $(shell id -u) USER := $(shell id -un) -MYUNAME := builder - -BASE_CONTAINER := centos73 -BASE_CONTAINER_TAG := local/dev-centos:7.3 -BASE_DOCKERFILE := Dockerfile.centos73 - -TC_CONTAINER_NAME := $(USER)-centos-builder -TC_CONTAINER_TAG := local/$(USER)-stx-builder:7.3 -TC_DOCKERFILE := Dockerfile.centos73.TC-builder # Import the build config NULL := $(shell bash -c "source buildrc; set | sed -E '/^[[:alnum:]_]+/s/=/:=/' | sed 's/^//' > .makeenv") include .makeenv +MYUNAME ?= $(USER) +BASE_CONTAINER := centos73 +BASE_CONTAINER_TAG := local/dev-centos:7.3 +BASE_DOCKERFILE := Dockerfile.centos73 + +TC_CONTAINER_NAME := $(MYUNAME)-centos-builder +TC_CONTAINER_TAG := local/$(MYUNAME)-stx-builder:7.3 +TC_DOCKERFILE := Dockerfile.centos73.TC-builder + + # Base CentOS container base-build: diff --git a/tb.sh b/tb.sh index 019922c1..9ebf1965 100755 --- a/tb.sh +++ b/tb.sh @@ -21,8 +21,8 @@ fi CMD=$1 -TC_CONTAINER_NAME=${USER}-centos-builder -TC_CONTAINER_TAG=local/${USER}-stx-builder:7.3 +TC_CONTAINER_NAME=${MYUNAME}-centos-builder +TC_CONTAINER_TAG=local/${MYUNAME}-stx-builder:7.3 TC_DOCKERFILE=Dockerfile.centos73.TC-builder function exec_container { @@ -33,7 +33,7 @@ function exec_container { function run_container { # create localdisk - mkdir -p ${LOCALDISK}/designer/${USER}/${PROJECT} + mkdir -p ${LOCALDISK}/designer/${MYUNAME}/${PROJECT} docker run -it --rm \ --name ${TC_CONTAINER_NAME} \