Skip to content

References to long syntax for --publish are incorrect #5370

Closed

Description

@lachlancooper

Problem description

A number of locations throughout the docs give examples using the long syntax for --publish. A typical example is docker-for-aws/load-balancer.md:

docker service create --name nginx --publish target=80,port=80 nginx

However, port= is invalid syntax. Running the above command on a new Docker CE 17.09.0 cluster reports:

invalid argument "target=80,port=80" for --publish: invalid field key port
See 'docker service create --help'.

Rather than target and port, the relevant parameters are published and target. I base this on the port handling code: https://github.com/docker/cli/blob/d7f6563efc059dcc59b21f30f68e9e8282481af9/opts/port.go#L14

Corrected, the above example would be:

docker service create --name nginx --publish published=80,target=80 nginx

Problem location

docker-for-aws/deploy.md
docker-for-aws/load-balancer.md
docker-for-azure/deploy.md
engine/admin/prometheus.md
engine/swarm/configs.md
engine/swarm/ingress.md
engine/swarm/secrets.md
engine/swarm/services.md
engine/swarm/stack-deploy.md
registry/deploying.md

Project version(s) affected

All.

Suggestions for a fix

It appears the issue was introduced in #5323. The examples need to be updated on all referenced pages. Some care will be needed to update engine/swarm/ingress.md as the documentation is more detailed and refers to a mix of parameters: <PUBLISHED-PORT>, <CONTAINER-PORT>, and <TARGET-PORT>.

The related issue docker/cli#695 will also need a fix.

Activity

  1. docker-robott commented on Mar 11, 2023

    @docker-robott
    Collaborator

    Closed issues are locked after 30 days of inactivity.
    This helps our team focus on active issues.

    If you have found a problem that seems similar to this, please open a new issue.

    /lifecycle locked

  2. locked and limited conversation to collaborators on Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions