【发布时间】:2019-10-21 01:27:36
【问题描述】:
我尝试使用testcontainers 的 docker-compose 模块编写一个 spring-boot 集成测试。我得到以下异常 启动:
java.lang.ExceptionInInitializerError
Caused by: com.github.dockerjava.api.exception.InternalServerErrorException:
{"message":"Get https://quay.io/v2/: dial tcp: lookup quay.io on 192.168.65.1:53: no such host"}
我已经尝试使用 Env 添加我们公司的 http 代理,但它不起作用。
@RunWith(SpringRunner.class)
@SpringBootTest
public class FtpExportIntegrationTest {
@ClassRule
public static DockerComposeContainer environment =
new DockerComposeContainer(new File("src/test/resources/docker-compose.yml"))
.withExposedService("search-kafka", 9092)
.withEnv("HTTP_PROXY", "http://proxy.mycompany.com:8080")
.withEnv("HTTPS_PROXY", "http://proxy.mycompany.com:8080")
.withEnv("http_proxy", "http://proxy.mycompany.com:8080")
.withEnv("https_proxy", "http://proxy.mycompany.com:8080");
【问题讨论】:
标签: spring-boot testcontainers