You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _docs/pipelines/service-containers.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -491,10 +491,19 @@ Notice that in that case the sequence of events is the following
491
491
492
492
Ideally, your application should be able to access other services by other DNS names that are fully configurable (this is a very good practice for[integration tests]({{site.baseurl}}/docs/testing/integration-tests/) as well).
493
493
494
-
Sometimes, however, and especially in legacy applications, your application might be hardcoded to look at other services at`localhost`.
495
-
In that case, you can use the attribute`shared_host_network: true` on the services definition. Now all linked containers can access each other's services via localhost.
494
+
Sometimes however, and especially in legacy applications, your application might be hardcoded to look at other services at`localhost`.
495
+
In that case, you can use the attribute`shared_host_network: true` on the services definition. Now all linked containers can access each other's services via`localhost`.
496
496
When`composition: ./docker-compose.yml` is used, this parameter is supported only in on-premises and hybrid environments. In cloud environments, for security reasons, this parameter is ignored.
497
497
498
+
>NOTE:
499
+
We recommend that you only use this option as a last resort. Hard coding`localhost` as a requirement in your services adds extra constraints to integration tests, especially in dynamic test environments.
500
+
501
+
502
+
>WARNING:
503
+
The value of`shared_host_network` affects how you access service containers:
504
+
* To access all containers on`localhost`, set`shared_host_network` to`true`.
505
+
* To access all containers by`name`, set`shared_host_network` to`false`.
506
+
498
507
Here is an example:
499
508
500
509
`codefresh.yml`
@@ -548,8 +557,7 @@ steps:
548
557
{% endraw %}
549
558
{% endhighlight %}
550
559
551
-
Note: we do recommend you only use this option as a last resort. You should not hardcode "localhost" as a requirement in your services as
552
-
it adds extra constraints with integration tests (and especially with dynamic test environments).