Skip to content

Is there a loop in the command? #11

Open
@songyu-wang98

Description

@songyu-wang98

I'm new to Docker and I'm confused when I try to understand the command

docker run --rm -it -p <listen-port>:<listen-port> -p <remote-port>:<remote-port> kevinwan/tproxy:v1 tproxy -l 0.0.0.0 -p <listen-port> -r host.docker.internal:<remote-port>

I'm gonna split the command into 2 parts:

  1. docker run --rm -it -p <listen-port>:<listen-port> -p <remote-port>:<remote-port> kevinwan/tproxy:v1: The flag -p map 2 ports of the host to the container, that't alright;
  2. tproxy -l 0.0.0.0 -p <listen-port> -r host.docker.internal:<remote-port>: The -r host.docker.internal:<remote-port> part cause the container access the host port directly, which I think may cause a loop like this:

Docker 端口映射

Could you please help me to figure it out?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions