-1

I have a docker container with tcserver on it with the UI of an application on it. I have a second docker container that is also running tcserver, but this one has the applications engine.

I am trying to get these two to talk to each other somehow, because when I access the UI on the web browser it says that it is not connected to the engine. How can I achieve this?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
V Kay
  • 11
  • 1

3 Answers3

0

You need to link the new allotted ports of the App Engine container to the UI Container, because the container can only be accessed by other containers through port.

Priyam Gupta
  • 250
  • 1
  • 14
0

As simple as that:

docker run --name engine -d tcserver-engine

docker run --name lala --link engine:tc-engine -d tcserver-ui

Inside lala container you can get engine container using the selected alias, in this example tc-engine

Camilo Silva
  • 8,283
  • 4
  • 41
  • 61
0

Use name and link in your docker run command or docker-compose.yml file?

docker run -ti --name server1 -p 8111:8111 ikamman/docker-tc-server
docker run -ti --name server2 --link server1 -p 8112:8111 ikamman/docker-tc-server
docker exec server2 curl server1:8111

Will return like this:

$ docker exec server2 curl server1:8111
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3546    0  3546    0     0   3290      0 --:--:--  0:00:01 --:--:--  3292
<!--
Page: maintenance-welcome
Stage: FIRST_START_SCREEN
State revision: 12
Timestamp: Wed Jul 27 20:30:06 UTC 2016
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>TeamCity Maintenance &mdash; TeamCity</title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta name="application-name" content="TeamCity"/>
  <meta name="description" content="Powerful Continuous Integration and Build Server"/>
  <link rel="icon" href="/img/icons/TeamCity512.png" sizes="512x512"/>
Ian Ellis
  • 389
  • 3
  • 8