Access container from outside (without port mapping)

I’m using Docker 1.13.1 on my Centos 7.3 virtual machine and run a container based on Centos 6 on it.
My problem is that I want to acccess my container from outside of the virtual machine but without port mapping!

Is there a way to access my container via IP or hostname?
Maybe I could give my container a IP from my DHCP like my virtual machine (10.10…) gets one?

  • Docker mount a volume as root
  • Docker run command on Bluemix does not allow to set environment variable correctly
  • How to recreate containers with Docker Compose on a Swarm Cluster of multiple nodes?
  • how to benchmark containers ? a lot of request, monitor memory and cpu usage
  • Use of container docker as a proxy for CF app to get public IP
  • How to send network packets to the docker container?
  • At the moment my container is using the default docker bridge (docker0) where he gets a IP like 172.17.0.*

    I have found a few similar questions but cant find a working solution for me.

    Thanks for helping me!

  • RUN command in Dockerfile not persisting from container to container
  • Private network issues with docker
  • docker with shared folder d drive
  • Increase HeapSize in Tomcat for all my applications
  • error running docker inside docker
  • Cross-device link not permitted Error in Meteor Project with Docker
  • 2 Solutions collect form web for “Access container from outside (without port mapping)”

    On the docker host, after the container started with option -itd, for example: docker run -itd --name=mycon imageName bash, you can use: docker exec -it mycon[or container_id] bash to enter the container.

    Just to close this. I did it like this:

    On this Link someone say that you have to give the ethernet port on your VM another IP.
    And run your Docker Container like this: docker run -i -t --rm -p yourip:22:22 docker/image:tag

    22 is the Port your service is using.

    For more detailed explanation got to the link!

    Thanks for your help.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.