3 ms·
Today I edited a Docker Compose YAML configuration file. The network configuration has "ports" sections, such as ports: - "8080:80" Which (assuming some
by HelloNurse 6y ago
Today I edited a Docker Compose YAML configuration file. The network configuration has "ports" sections, such as
ports:
- "8080:80"
Which (assuming some other network configurations) means that whatever answers to port 80 in the container can be reached at port 8080 of the host running Docker.
Simple syntax and straightforward semantics, but port numbers are integers: why strings? Because, as the Docker manual warns, YAML is clever.
> When mapping ports in the HOST:CONTAINER format, you may experience erroneous results when using a container port lower than 60, because YAML parses numbers in the format xx:yy as a base-60 value. For this reason, we recommend always explicitly specifying your port mappings as strings.