I have a very basic requirement which does not work when using pasta
networking mode.
Two containers, container app
and container db
need to communicate, specifically container app
needs to connect to container db
on port 3306
.
Without pasta, I would simply:
A: put the containers on the same network, and the app
container could simply connect to db:3306
B: run the db container with 127.0.0.1:12345:3306
, and the app
container would connect to host.containers.internal:12345
But when using pasta, neither of these works.
The only way I have figured out to make option B work is running the app
container with --network=pasta:-T,12345
, but this seems like a complicated solution for an easy problem, and I don’t even really want to map the database port to the host, because it is only accessed from within the app
container.
Is there a better/simpler way to accomplish this? (without using pods)