Skip to content

Add container_name option for specifying a custom container name - #1711

Merged
mnowster merged 3 commits into
docker:masterfrom
aanand:custom-names
Jul 21, 2015
Merged

mnowster merged 3 commits into
docker:masterfrom
aanand:custom-names

Conversation

@aanand

@aanand aanand commented Jul 16, 2015

Copy link
Copy Markdown

Closes #1518.

web:
  build: .
  container_name: my-web-container

Went with option 1 - a service with a custom name simply can't be scaled beyond 1 container. We let the Docker daemon enforce that.

@aanand

aanand commented Jul 16, 2015

Copy link
Copy Markdown
Author

ping @moxiegirl

Comment thread compose/service.py Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Service %s is attempting to use a container named % self.name. Docker requires each container have a unique name.'

Signed-off-by: Aanand Prasad <[email protected]>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth us also having a test that demonstrates that an error is raised if you try to call scale with a named container?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed this in person. For the record, we can look at increasing tests after code freeze depending on priority of other tasks.

@mnowster

Copy link
Copy Markdown

LGTM.

mnowster added a commit that referenced this pull request Jul 21, 2015
Add container_name option for specifying a custom container name
@mnowster
mnowster merged commit cc0bfea into docker:master Jul 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants