 			Cmd: ['/bin/bash', '-c', '/start']
 			Volumes:
 				'/dev': {}
-			Env: _.map app.env, (v, k) -> k + '=' + v
+			Env: _.map env, (v, k) -> k + '=' + v
 			ExposedPorts: ports
 		)
 		.then (container) ->

	.then ->
		console.log("Creating container:", app.imageId)
		ports = {}
		if app.env.PORT?
			maybePort = parseInt(app.env.PORT, 10)
			if parseFloat(app.env.PORT) is maybePort and maybePort > 0 and maybePort < 65535
				port = maybePort
		if port?
			ports[port + '/tcp'] = {}

						env[envVar.name] = envVar.value
				return {
					imageId: "#{process.env.REGISTRY_ENDPOINT}/#{path.basename(app.git_repository, '.git')}/#{app.commit}"
					env: JSON.stringify(env) # The env has to be stored as a JSON string for knex
				}

			remoteApps = _.indexBy(remoteApps, 'imageId')
