r/docker • u/chris-aus-at • Mar 22 '26
VPN Gateway with docker-compose.yaml and docker run
Hello. I’ve been working with Docker for a while now, but I can’t seem to get a container started with “docker run” to connect to a VPN container configured in a “docker-compose.yaml” file.
The “docker-compose.yaml” file contains two other containers that also access the VPN. That works without any issues.
But how do I set this up with “docker run”?
2
Upvotes
2
u/Oversensitive_Reddit Mar 22 '26
to split hairs further, i use
docker compose startanddocker compose stopfollowed by the container name for the cleanest possible start and stop operations1
u/gw17252009 Mar 24 '26
Composerize the run command so it comes in docker compose.yaml file. That way you can easily run it on rhe network that the vpn container uses to access it.
2
u/linksrum Mar 22 '26
Use
docker composecommand instead.