File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,6 +96,12 @@ 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+ for envvar in buildargs :
104+ dockerfile .write ("ARG {}={}" .format (envvar , buildargs [envvar ]))
99105client = docker .Client (version = 'auto' )
100106if registryLocation != "on-cluster" :
101107 registry = os .getenv ('DEIS_REGISTRY_HOSTNAME' , 'https://index.docker.io/v1/' )
@@ -112,7 +118,7 @@ def download_file(tar_path):
112118 rm = True ,
113119 pull = True ,
114120 path = '/app' ,
115- buildargs = json . loads ( os . getenv ( 'DOCKER_BUILD_ARGS' , '{}' )) )
121+ buildargs = buildargs )
116122log_output (stream , True )
117123print ("Pushing to registry" )
118124stream = client .push (registry + '/' + imageName , tag = imageTag , stream = True )
You can’t perform that action at this time.
0 commit comments