18 ms·
The port mapping is done by the container engine, not the container. Using low ports is allowed if the engine runs as root. Moreover I think it’s acceptable to
by hda111 5y ago
The port mapping is done by the container engine, not the container. Using low ports is allowed if the engine runs as root.
Moreover I think it’s acceptable to use uid 0 inside a rootless container like podman since it’s by default only mapped to the user running it.
- 0xbadcafebee 5y agoAWS Fargate won't let you remap ports. Whatever the container exposes, that's the port it's going to listen on. To work around this and other problems, I ended up making fat containers that start as root, and add entrypoints that can either run a process as root (to listen on low ports) or sudo to a user to drop perms before starting a process (to listen on high ports). There's also weird junk you sometimes need to do in order to capture file handles depending on how a container engine is running the container, which you need to do before you fork or drop privs. But it took me years to finally run into that use case, most people will never need to do this.