Docker-compose network blocks me out of my ec2 instance

I have a very weird problem, that is not reproducible i.e.happens sporadically:

  • when I run a docker-compose up command on an EC2 instance, it can interrupt my ssh connection. Then I’m no longer able to connect, it just freezes as if the port was not opened.
    And it seems to stay that way forever.
    BUT other users are able to ssh into the instance.

If I kill using another user account some docker networks (e.g. docker network prune) it fixes the problem.
All the containers I’m using use network host mode.

It also happened to another user with the same docker-compose app, this time he was blocked and I could connect suing my account and fix the problem.

Does anybody have an idea about what’s going on ?

Thanks.