How can I access a container from another container ?

Post Reply
ccc3
Starting out
Posts: 29
Joined: Sun Dec 11, 2011 8:25 am

How can I access a container from another container ?

Post by ccc3 »

Hi,

I have installed Jenkins and Gitlab containers and I would like to access Gitlab from Jenkins. Preferably in a way that would keep working after a restart of the NAS or of any of the containers.
Right now I am trying to use the following URL:

http://192.168.1.99:10080/mygroup/myproject.git
(where 192.168.1.99 is the NAS IP on the internal network (the way I access it from other machines) and 10080 is the NAS port that is forwarded to port 80 of the Gitlab container)

but it doesn't work. Seems like the Jenkins container doesn't have access to the local network. I am kinda new to containers, so not sure if that's normal or not, or how could I fix it.

Thanks.
Norcino
Starting out
Posts: 31
Joined: Fri May 20, 2016 1:56 am

Re: How can I access a container from another container ?

Post by Norcino »

Hi ccc3, a container gets, unless differently specified, the ip address of the virstual swirtch used by the container station (docker).
In my case this is a class A ip rante 10.0.x.x. For what you want to do, you have to configure your container to be bridged, a bridged container will obtain the IP address from the external DHCP server, like maybe your router.
Once your container belong to your network, you can access it, and from it, you can access other local ip addresses.
Post Reply

Return to “Container Station”