Give containers a name

This commit is contained in:
Girish Ramakrishnan
2015-11-02 09:34:31 -08:00
parent 58d6166592
commit 95b2bea828
2 changed files with 5 additions and 3 deletions

View File

@@ -117,8 +117,9 @@ function downloadImage(manifest, callback) {
}, callback);
}
function createSubcontainer(app, cmd, callback) {
function createSubcontainer(app, name, cmd, callback) {
assert.strictEqual(typeof app, 'object');
assert.strictEqual(typeof name, 'string');
assert(!cmd || util.isArray(cmd));
assert.strictEqual(typeof callback, 'function');
@@ -159,6 +160,7 @@ function createSubcontainer(app, cmd, callback) {
var containerOptions = {
// do _not_ set hostname to app fqdn. doing so sets up the dns name to look up the internal docker ip. this makes curl from within container fail
Hostname: semver.gte(targetBoxVersion(app.manifest), '0.0.77') ? app.location : config.appFqdn(app.location),
Name: name, // used for filtering logs
Tty: isAppContainer,
Image: app.manifest.dockerImage,
Cmd: cmd,
@@ -201,7 +203,7 @@ function createSubcontainer(app, cmd, callback) {
}
function createContainer(app, callback) {
createSubcontainer(app, null, callback);
createSubcontainer(app, app.id /* name */, null /* cmd */, callback);
}
function startContainer(containerId, callback) {