When running the Docker daemon as a non-root user (Rootless mode), executing docker compose up will give an error similar to
cannot expose privileged port 80
Solution
There are multiple ways to solve this. All are mentioned in the official Docker docs, see the link above.
On my opinion, the simplest non-breaking solution is to use a non-privileged port by default.
Additionally, the current solution even extends developer's possibilities: a developer can specify a custom port via HTTPBIN_CUSTOM_PORT environment variable before running docker compose up.
Problem
See https://docs.docker.com/engine/security/rootless/#networking-errors
When running the Docker daemon as a non-root user (Rootless mode), executing
docker compose up
will give an error similar toSolution
There are multiple ways to solve this. All are mentioned in the official Docker docs, see the link above.
On my opinion, the simplest non-breaking solution is to use a non-privileged port by default.
Additionally, the current solution even extends developer's possibilities: a developer can specify a custom port via
HTTPBIN_CUSTOM_PORT
environment variable before runningdocker compose up
.Breaking changes
No.
Are end-users affected?
No.