Docker Community Forums

Share and learn in the Docker community.

How to access docker container from another machine on local network

@astralix, because of the design of Docker, I think what you’re trying to do is quite difficult.

Now, I’m a noob so could be way off here, but it seems to me that Docker handles application sets… It doesn’t virtualise the OS or any of ‘that layer’, which is partly why you’re struggling to assign a unique IP to a container. I’m imagine there’s some brave methods of hackery via assigning multiple IPs to the host and attempting to ‘present’ the additional addresses to a given container, but it looks like an uphill battle to me.

I have however, stumbled across a particularly complicated guide with IPTables and whanot using macvlan networks here, but honestly, after skimming through, I couldn’t follow it. It’s definitely what you’re after, as the documentation talks about assigning a MAC to the container…

However, once I understood the container shares the same IP as the host, I got over it and enjoyed not banging my head against the wall.

  • Personally, I think you’d be better of moving ‘down the stack’ and exploring ESXi, Hyper-V, Xen etc, or digging into the macvlan thing.

Can you explain a way to do the same on linux?

Hi All , I am new to docker. I have java application which can be run using "javaws http://localhost:9088/rtccClient/rtcc.jnlp. I created docker container for the java application in my windows machine using “ibmcom/websphere-liberty:latest” as base image. now my windows machine has docker container where linux is there and my java application is running inside it . I exposed port 9080 in my docker file and i am trying to run application from my windows machine using command “javaws http://localhost:9080/rtccClient/rtcc.jnlp”. but it was not working
. can some one tell what is the mistake i am doing? below is my docker file.

FROM ibmcom/websphere-liberty:latest
USER root
RUN yum -y install unixODBC
RUN yum -y install libaio
RUN mkdir -pv /basic
RUN mkdir -pv /resources/security
COPY ./basicinstaclient/oracle-instantclient19.8-basic-19.8.0.0.0-1.x86_64.rpm /basic/
RUN rpm -i /basic/oracle-instantclient19.8-basic-19.8.0.0.0-1.x86_64.rpm
ADD ./rtcc.ear /opt/ibm/wlp/usr/servers/defaultServer/apps
ADD ./rtccClient.war /opt/ibm/wlp/usr/servers/defaultServer/apps
ADD ./resources/bootstrap.properties /opt/ibm/wlp/usr/servers/defaultServer
ADD ./resources/server.xml /opt/ibm/wlp/usr/servers/defaultServer
ADD ./resources/hibernate/ /opt/ibm/wlp/usr/servers/defaultServer/hibernate
ADD ./resources/oracle/ /opt/ibm/wlp/usr/servers/defaultServer/oracle
ADD ./certificates/ /opt/ibm/wlp/usr/servers/defaultServer/resources/security
EXPOSE 9080

below error i am getting
CouldNotLoadArgumentException[ Could not load file/URL specified: http://localhost:9080/rtccClient/rtcc.jnlp]