File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,14 @@ def download_file(tar_path):
9696with tarfile .open ("apptar" , "r:gz" ) as tar :
9797 tar .extractall ("/app/" )
9898log ("extracting tar file complete" )
99+ buildargs = json .loads (os .getenv ('DOCKER_BUILD_ARGS' , '{}' ))
100+ # inject docker build args into the Dockerfile so we get around Dockerfiles that don't have things
101+ # like PORT defined.
102+ with open ("/app/Dockerfile" , "a" ) as dockerfile :
103+ # ensure we are on a new line
104+ dockerfile .write ("\n " )
105+ for envvar in buildargs :
106+ dockerfile .write ("ARG {}\n " .format (envvar ))
99107client = docker .Client (version = 'auto' )
100108if registryLocation != "on-cluster" :
101109 registry = os .getenv ('DEIS_REGISTRY_HOSTNAME' , 'https://index.docker.io/v1/' )
@@ -112,7 +120,7 @@ def download_file(tar_path):
112120 rm = True ,
113121 pull = True ,
114122 path = '/app' ,
115- buildargs = json . loads ( os . getenv ( 'DOCKER_BUILD_ARGS' , '{}' )) )
123+ buildargs = buildargs )
116124log_output (stream , True )
117125print ("Pushing to registry" )
118126stream = client .push (registry + '/' + imageName , tag = imageTag , stream = True )
You can’t perform that action at this time.
0 commit comments