mrmc-mc / Forward-Port-Containers-Docker

Forward Port between Docker Containers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About:

Sometimes we can not use the docker-compose.yml configuration and we want to communicate between containers or we want to communicate from inside the container

Forward-Port-Containers-Docker

Forward Port between Docker Containers (in the same network)


1. install socat on your container:

apt update && apt install socat

2. Forward local port to another host:port:

socat TCP-LISTEN:80,fork TCP:<Target Host>:8080 &

Example: socat TCP-LISTEN:80,fork TCP:mycon:8080 &

About

Forward Port between Docker Containers


Languages

Language:Dockerfile 100.0%