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
Summary
Dockerfileline 5 passes$MANAGER_URL(a URL build arg, e.g.http://host:8080) to theEXPOSEdirective, which only accepts port numbers. This is silently ignored by Docker and means the intended port is never declared.Affected file
Dockerfile:5EXPOSEonly accepts integers (orinteger/protocol). Passing a URL string causes Docker to either silently ignore the directive or error, depending on the version. The port embedded in$MANAGER_URLis never actually exposed.Impact
docker run -Por Docker Composeexpose:for the manager URL port will not work as expected.Recommendation
Remove line 5 (
EXPOSE $MANAGER_URL). If the manager backend port needs to be declared, extract just the port number as a separateARGand expose that:Or simply document the expected port in comments and let
docker-compose.ymlhandle port mapping explicitly.Related