'Communication between a client and a Docker Container on other server

I am currently looking for the possibility to communicate with a Docker container that is not running on my own device but on a remote server. I am also in the same network through a VPN. This server is running multiple Docker containers but I only want to communicate with one specific container. Currently it would be enough for me to get a ping response.

I can get to the information of the container withdocker network ls and docker network inspect .... So I can find the IP of the container (172.17.XXX.XXX). But when I try to ping it, I get the response from a different IP address (xxx.xxx.xxx.xxx):

Ping is executed for 172.17.XXX.XXX with 32 bytes of data:
    Reply from xxx.xxx.xxx.xxx: Destination network not reachable.
    Reply from xxx.xxx.xxx.xxx: Destination network not reachable.
    Reply from xxx.xxx.xxx.xxx: Destination network not reachable.
    Reply from xxx.xxx.xxx.xxx: Destination network not reachable.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source