Skip to content

Contradicting information about port mappings in service containers #34459

@hsnabszhdn

Description

@hsnabszhdn

Code of Conduct

What article on docs.github.com is affected?

What part(s) of the article would you like to see updated?

In both pages linked about, it says that if you don't specify the port, it maps the host port to a randomly chosen port on the container:

About service containers / Mapping Docker host and service container ports

8080/udp Map a randomly chosen UDP port in the container to UDP port 8080 on the Docker host.

I think, it's the other way around: "Map a randomly chosen port on the Docker host to UDP port 8080 in the container"

Workflow syntax for GitHub Actions / jobs.<job_id>.services / Example: Using localhost

❌ When you specify the Docker host port but not the container port, the container port is randomly assigned to a free port.

I think, it should be: "When you specify the container port but not the Docker host port, the container port is randomly assigned to a free port."

Additional information

In the following page, I think the correct statement is used:

Accessing contextual information about workflow runs / job context / Example usage of the job context

✅ This example workflow configures a PostgreSQL service container, and automatically maps port 5432 in the service container to a randomly chosen available port on the host.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SME reviewedAn SME has reviewed this issue/PRactionsThis issue or pull request should be reviewed by the docs actions teamcontentThis issue or pull request belongs to the Docs Content teamhelp wantedAnyone is welcome to open a pull request to fix this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions