Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

How to handle container restarts with other containers? #8

Closed
Pingumania opened this issue Sep 21, 2020 · 2 comments
Closed

How to handle container restarts with other containers? #8

Pingumania opened this issue Sep 21, 2020 · 2 comments

Comments

@Pingumania
Copy link

Containers that use network_mode: service:openvpn-client lose connection to the openvpn container when the openvpn container is restarted or recreated.

Usually that doesn't happen often because there is no need to restart or recreate it.

There is another case were the same problem occurs I think. When restarting all containers at once. Probably because openvpn should be the first one to be fully up inside the container but the others are faster and a reference changed that can only be fixed by restarting.

This is just my observation and theory I am no expert with this stuff.

Is there a way to prevent this from happening?

@wfg
Copy link
Owner

wfg commented Sep 22, 2020

To my knowledge, this problem only happens if the VPN container is removed after the other containers are created and is not unique to this image.

There is another case were the same problem occurs I think. When restarting all containers at once. Probably because openvpn should be the first one to be fully up inside the container but the others are faster and a reference changed that can only be fixed by restarting.

I haven't seen this happen using Compose. Having network_mode set seems to guarantee that my containers using the VPN are created after the VPN container.

@Pingumania
Copy link
Author

I found this issue at the compose github: docker/compose#6626
This seems to be me my problem. I will try to make it work with the mentioned workaround.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants