EXPOSE instruction should not define an IP address or host-port mapping.Documentation Index
Fetch the complete documentation index at: https://tally.wharflab.com/llms.txt
Use this file to discover all available pages before exploring further.
| Property | Value |
|---|---|
| Severity | Warning |
| Category | Correctness |
| Default | Enabled |
Description
TheEXPOSE instruction in a Dockerfile is used to indicate which ports the
container listens on at runtime. It should not include an IP address or
host-port mapping.
Including an IP address or host-port mapping in the EXPOSE instruction does
not actually publish the port and can be misleading. Use docker run -p or
docker compose port mappings to bind host ports at runtime.