Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding the hostname option to docker service command #27857

Merged
merged 1 commit into from
Nov 4, 2016

Conversation

niau
Copy link
Contributor

@niau niau commented Oct 28, 2016

This PL is in addition to #25437
- What I did
Added option hostname in docker service create command.
- How I did it
I changed the docker client, updated the ContainerSpec structures in docker/swarm repo, so that this option is serialized to the swarm agents from the clients.
- How to verify it
docker service create --name test --hostname vasko
docker exec test.1. hostname
- Description for the changelog
This pull request will allow to specify hostname option to the docker service create command.
The same hostname will be set on all containers.
- A picture of a cute animal (not mandatory but encouraged)
Since the hostname got quite persistent in its unwillingness to be rebased :) You got a picture of the cutest and the most persistent animal on the world ;)
water bears

Signed-off-by: Nikolay Milovanov nmil@itransformers.net

@niau
Copy link
Contributor Author

niau commented Oct 28, 2016

@stevvooe this is second part of the pull request for the docker service hostname feature. In #25437 we got only the vendoring part. To get it feature complete this one has also to go through.

@stevvooe
Copy link
Contributor

stevvooe commented Nov 1, 2016

LGTM

@vdemeester
Copy link
Member

@niau needs a rebase 👼

@vdemeester vdemeester self-assigned this Nov 2, 2016
@niau niau force-pushed the docker-service-hostname-2 branch 3 times, most recently from c1db3a0 to 5d40724 Compare November 2, 2016 13:16
@niau
Copy link
Contributor Author

niau commented Nov 2, 2016

@vdemeester clean as a baby ass :)

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 🐸

@vdemeester
Copy link
Member

Moving to docs-review
/cc @thaJeztah @mstanleyjones

Copy link
Contributor

@mdlinville mdlinville left a comment

Choose a reason for hiding this comment

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

Please update the reference docs for swarm service as well...

@niau
Copy link
Contributor Author

niau commented Nov 2, 2016

@mstanleyjones I assume that this means that I have to do another pull request and update the documents here https://github.com/docker/docker.github.io/tree/master/engine/reference

@mdlinville
Copy link
Contributor

@niau no, sorry for the confusion. The reference docs are maintained in docker/docker and brought into the docs repo periodically and currently manually. So you can update them as part of this PR.

Signed-off-by: Nikolay Milovanov <nmil@itransformers.net>
@niau niau force-pushed the docker-service-hostname-2 branch from 5d40724 to b222aa1 Compare November 3, 2016 10:02
@niau
Copy link
Contributor Author

niau commented Nov 3, 2016

@mstanleyjones ping, I have added the documentation piece for the docker service create command in the reference docs. Not sure why the windowsRS1 test has failed. I doubt that the command documentation update did something to it...

Copy link
Contributor

@mdlinville mdlinville left a comment

Choose a reason for hiding this comment

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

docs LGTM

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

docs LGTM 🐸

@vdemeester vdemeester added impact/cli and removed status/needs-attention Calls for a collective discussion during a review session labels Nov 4, 2016
@vdemeester vdemeester added this to the 1.13.0 milestone Nov 4, 2016
@vdemeester vdemeester merged commit b4e14c6 into moby:master Nov 4, 2016
@thaJeztah
Copy link
Member

Do we need this in docker service update as well?

@thaJeztah
Copy link
Member

also ping @albers @sdurrheimer for completion scripts

@niau
Copy link
Contributor Author

niau commented Nov 4, 2016

@vdemeester, @thaJeztah thanks for merging this.
In the initial use case that we got with @vasil-yordanov there was no need for docker service update --hostname, however i assume it will be more feature complete if update is also supported.
If you also think that it would be better to support also the update I don't mind to try to implement that in a week or two.

@thaJeztah
Copy link
Member

@niau overall, my thought is that (for services) anything you can set during create, you should be able to change using update (there are some exceptions), so personally, I would be +1 to have it on update as well

@niau
Copy link
Contributor Author

niau commented Nov 5, 2016

@thaJeztah thanks will try to make it happen. Once ready will spawn a new pull request. Now since we passed through the process would be much easier ;)

@yellowmegaman
Copy link

Great job! Any way it can be used to set hostname like this:

docker service create --name test --hostname vasko --replicas 7
docker exec test.2.whatever ping -c2 vasko.1 vasko2 etc?

Looking for some solution like --hostname for i in replicasl set hostname vasko.$i
It could be really rabbitmq and couchbase friendly.

@thaJeztah
Copy link
Member

@yellowmegaman see the templating feature that's added in docker 1.13; #28486

@yellowmegaman
Copy link

@thaJeztah thanks a bunch!

thaJeztah added a commit to thaJeztah/docker that referenced this pull request Jan 16, 2017
Pull request moby#27745 added support for the
client to talk to older versions of the daemon. Various flags were added to
docker 1.13 that are not compatible with older daemons.

This PR adds annotations to those flags, so that they are automatically hidden
if the daemon is older than docker 1.13 (API 1.25).

Not all new flags affect the API (some are client-side only). The following
PR's added new flags to docker 1.13 that affect the API;

- moby#23430 added `--cpu-rt-period`and `--cpu-rt-runtime`
- moby#27800 / moby#25317 added `--group` / `--group-add` / `--group-rm`
- moby#27702 added `--network` to `docker build`
- moby#25962 added `--attachable` to `docker network create`
- moby#27998 added `--compose-file` to `docker stack deploy`
- moby#22566 added `--stop-timeout` to `docker run` and `docker create`
- moby#26061 added `--init` to `docker run` and `docker create`
- moby#26941 added `--init-path` to `docker run` and `docker create`
- moby#27958 added `--cpus` on `docker run` / `docker create`
- moby#27567 added `--dns`, `--dns-opt`, and `--dns-search` to `docker service create`
- moby#27596 added `--force` to `docker service update`
- moby#27857 added `--hostname` to `docker service create`
- moby#28031 added `--hosts`, `--host-add` / `--host-rm` to `docker service create` and `docker service update`
- moby#28076 added `--tty` on `docker service create` / `docker service update`
- moby#26421 added `--update-max-failure-ratio`, `--update-monitor` and `--rollback` on `docker service update`
- moby#27369 added `--health-cmd`, `--health-interval`, `--health-retries`, `--health-timeout` and `--no-healthcheck` options to `docker service create` and `docker service update`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
dnephin pushed a commit to dnephin/docker that referenced this pull request Apr 17, 2017
…name-2

Adding the hostname option to docker service command
andrewhsu pushed a commit to docker-archive/docker-ce that referenced this pull request May 19, 2017
Pull request moby/moby#27745 added support for the
client to talk to older versions of the daemon. Various flags were added to
docker 1.13 that are not compatible with older daemons.

This PR adds annotations to those flags, so that they are automatically hidden
if the daemon is older than docker 1.13 (API 1.25).

Not all new flags affect the API (some are client-side only). The following
PR's added new flags to docker 1.13 that affect the API;

- moby/moby#23430 added `--cpu-rt-period`and `--cpu-rt-runtime`
- moby/moby#27800 / moby/moby#25317 added `--group` / `--group-add` / `--group-rm`
- moby/moby#27702 added `--network` to `docker build`
- moby/moby#25962 added `--attachable` to `docker network create`
- moby/moby#27998 added `--compose-file` to `docker stack deploy`
- moby/moby#22566 added `--stop-timeout` to `docker run` and `docker create`
- moby/moby#26061 added `--init` to `docker run` and `docker create`
- moby/moby#26941 added `--init-path` to `docker run` and `docker create`
- moby/moby#27958 added `--cpus` on `docker run` / `docker create`
- moby/moby#27567 added `--dns`, `--dns-opt`, and `--dns-search` to `docker service create`
- moby/moby#27596 added `--force` to `docker service update`
- moby/moby#27857 added `--hostname` to `docker service create`
- moby/moby#28031 added `--hosts`, `--host-add` / `--host-rm` to `docker service create` and `docker service update`
- moby/moby#28076 added `--tty` on `docker service create` / `docker service update`
- moby/moby#26421 added `--update-max-failure-ratio`, `--update-monitor` and `--rollback` on `docker service update`
- moby/moby#27369 added `--health-cmd`, `--health-interval`, `--health-retries`, `--health-timeout` and `--no-healthcheck` options to `docker service create` and `docker service update`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 5d2722f83db9e301c6dcbe1c562c2051a52905db
Component: cli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants