Testcontainers-java: Use of links between containers should be deprecated

Created on 27 Sep 2017  路  10Comments  路  Source: testcontainers/testcontainers-java

As discussed in #463, docker networks seem mature enough to use, and links are officially not recommended any more.

We'd like to deprecate use of links; off the top of my head I believe we ought to do the following things:

  • [x] Obviously, mark the container addLink method as deprecated with a clear comment
  • [x] Links aren't currently documented very well, but update the docs with a clear enough description of the networking support, so that ad-hoc linking can be done easily by users
  • [x] Modify Webdriver VNC recorder sidecar container to remove use of links
  • [x] Modify Docker Compose support; can we remove use of the ambassador container now?
resolutioacknowledged

Most helpful comment

I'd very much appreciate some docs around networks :)

All 10 comments

I'm really looking forward to removing the ambassador container, I believe this will make things a lot easier in more complex CI environments.

AFAIK the only thing missing now is the documentation update?

I'd very much appreciate some docs around networks :)

@felixbarny Yep you are right, PR appreciated :smile_cat:

@felixbarny yes, the docs are missing and I feel sorry about it (since I was the one who implemented the networks support)
However, it is as simple as .withNetwork(networkInstance) and until it is implemented you an check existing usages in tests, i.e. Kafka:
https://github.com/testcontainers/testcontainers-java/blob/b5181f784c63b91a61ec68cd58acc522ce4d2dbc/modules/kafka/src/test/java/org/testcontainers/containers/KafkaContainerTest.java#L52-L69

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this.

This issue has been automatically closed due to inactivity. We apologise if this is still an active problem for you, and would ask you to re-open the issue if this is the case.

Reopening - docs still needed

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this.

@rnorth given https://www.testcontainers.org/features/networking/#advanced-networking, should we close the issue now? :)

Was this page helpful?
0 / 5 - 0 ratings