N
N
nano_e_t_42020-05-15 15:44:40
linux
nano_e_t_4, 2020-05-15 15:44:40

How to forward traffic in docker?

Hello everyone
, there is such a task: you need to cling to the application to a remote host, but through the vpn client (openconnect). the implementation is such that it is not possible to connect by another client or by certificates. there is a wish to make a sheaf application the client means of a docker. Accordingly, there is a docker container for the vpn client (vimagick / openconnect) and a docker container for the application. question - how to forward traffic from the container with the application to the container with the client?
I tried to create a network and connect them to the same network, but it does not take off

docker network create vpn-client
docker run -p 9090:9090 --network=vpn-client 6d51b6be9afb vpn-client-container
docker run -p 9090:9090 --network=vpn-client 6d51b6be9afb awsemo-app

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shurshur, 2020-05-24
@shurshur

The simplest solution:

docker run -p 9090:9090 --network=container:vpn-client-container 6d51b6be9afb awsemo-app

- both containers will use the same network stack and the same IP.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question