do not override dockerfile cmd

This commit is contained in:
Aleksis Brezas 2014-11-19 20:26:09 +00:00 committed by Pablo Carranza Vélez
parent fcc6d1375d
commit 460768d366

View File

@ -101,7 +101,9 @@ exports.start = start = (app) ->
updateDeviceInfo(status: 'Downloading')
dockerUtils.fetchImageWithProgress app.imageId, (progress) ->
updateDeviceInfo(download_progress: progress.percentage)
.then ->
.then ->
docker.getImage(app.imageId).inspectAsync()
.then (imageInfo) ->
console.log('Creating container:', app.imageId)
updateDeviceInfo(status: 'Starting')
ports = {}
@ -109,9 +111,14 @@ exports.start = start = (app) ->
portList.forEach (port) ->
ports[port + '/tcp'] = {}
if imageInfo?.Config?.Cmd
cmd = imageInfo.Config.Cmd
else
cmd = [ '/bin/bash', '-c', '/start' ]
docker.createContainerAsync(
Image: app.imageId
Cmd: [ '/bin/bash', '-c', '/start' ]
Cmd: cmd
Tty: true
Volumes:
'/data': {}