Skip to content

Bug: Dockerfile EXPOSE $MANAGER_URL passes URL build arg instead of port number #661

Description

@LucasMaupin

Summary

Dockerfile line 5 passes $MANAGER_URL (a URL build arg, e.g. http://host:8080) to the EXPOSE directive, which only accepts port numbers. This is silently ignored by Docker and means the intended port is never declared.

Affected file

Dockerfile:5

ARG MANAGER_URL        # e.g. "http://intercom-manager:8080"
EXPOSE $PORT           # ✓ correct — port number
EXPOSE $MANAGER_URL    # ✗ wrong  — URL string, not a port

EXPOSE only accepts integers (or integer/protocol). Passing a URL string causes Docker to either silently ignore the directive or error, depending on the version. The port embedded in $MANAGER_URL is never actually exposed.

Impact

  • Any port-publishing that relies on docker run -P or Docker Compose expose: for the manager URL port will not work as expected.
  • Docker image consumers may not realise the manager port is not exposed, causing silent connectivity failures.

Recommendation

Remove line 5 (EXPOSE $MANAGER_URL). If the manager backend port needs to be declared, extract just the port number as a separate ARG and expose that:

ARG MANAGER_PORT=8080
EXPOSE $PORT
EXPOSE $MANAGER_PORT

Or simply document the expected port in comments and let docker-compose.yml handle port mapping explicitly.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    MediumPriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions