gpt4 book ai didi

java - Arquillian Cube 的容器对象中是否有主机名属性?

转载 作者:行者123 更新时间:2023-12-02 02:00:39 24 4
gpt4 key购买 nike

我正在尝试设置 Arquillian Cube 容器对象的主机名,就像在 docker-compose 文件中一样。是否可以使用一些 Java 注释来做到这一点?

这是一个简单的 LDAP 容器,我将使用它来进行 Spring 应用程序测试。我基本上试图避免使用 docker-compose 文件。

最佳答案

来自Arquillian docs :

6.1. Networks

You can define networks using cube format (Docker Compose v1 (the one supported by Cube) does not have support to networks. For defining them you only need to use the reserved word networks.

src/test/resources/cube:

networks: //(1)
mynetwork: //(2)
driver: bridge //(3)
tomcat:
image: tutum/tomcat:7.0
exposedPorts: [8089/tcp]
networkMode: mynetwork // (4)
  1. Reserved word to indicate start of network definition
  2. Network name
  3. Driver used. Currently this is the only supported property due not support in docker-java
  4. Sets the network where container must join.

这是使用 Docker-Compose 格式的替代方案。

希望这能回答您的问题!

关于java - Arquillian Cube 的容器对象中是否有主机名属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57376615/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com