I have a Docker container that exposes a port to an application (e.g. Redis, which exposes port 6379). Instead of exposing 6379 on my host (and hence 1. taking up one of my precious few 65535 port numbers and 2. exposing the Redis cache to all users on my host), I would like to instead connect to Redis via a Unix socket in my local directory (e.g. by using $ redis-cli -s ~/redis.sock).
However, Docker only appears to provide port-to-port forwarding (via the ports option in docker compose, or the -p switch in docker run) or socket-to-socket forwarding (via exposing the directory the socket is contained in). Is there another way (within any GCI-compliant container system) to do the direct socket-to-port translation I'm looking for, or is this a limitation inherent to the GCI standard?
I am aware that Redis itself can listen on a Unix socket, though I'm interested in this for applications that don't have that feature available.