Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb766289

Browse files
authored
Cf shared host network updates (#630)
* Update service-containers.mdReadded missing warning on shared_host_network = true implications* Update service-containers.mdRewrote note after clarifications
1 parent750d529 commitb766289

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

‎_docs/pipelines/service-containers.md‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -491,10 +491,19 @@ Notice that in that case the sequence of events is the following
491491

492492
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).
493493

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`.
496496
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.
497497

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+
498507
Here is an example:
499508

500509
`codefresh.yml`
@@ -548,8 +557,7 @@ steps:
548557
{% endraw %}
549558
{% endhighlight %}
550559

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).
560+
553561

554562

555563
##Limitations

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp