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