如何解决容器启动失败:在Bitbucket管道的集成测试中将Testcontainers Localstack 1.15.0-rc2与Maven / Spring Boot结合使用
在Spring Boot集成测试中运行Testcontainers Localstack(https://mvnrepository.com/artifact/org.testcontainers/localstack/1.15.0-rc2)时出错。
它在本地运行良好,但随后在Bitbucket管道上失败。
错误:
Container startup failed
org.testcontainers.containers.ContainerLaunchException: Container startup failed
Caused by: org.testcontainers.containers.ContainerFetchException: Can't get Docker image: RemoteDockerImage(imageName=localstack/localstack:latest,imagePullPolicy=DefaultPullPolicy())
Caused by: com.github.dockerjava.api.exception.DockerException: Status 403: {"message":"authorization denied by plugin pipelines: Invalid content length provided"}
pipelines.yml摘录
definitions:
services:
docker:
memory: 2048
localstack:
image: localstack/localstack:latest
environment:
SERVICES: S3
LOCALSTACK_HOSTNAME: localhost
HOSTNAME: localhost
steps:
- parallel: &buildStepMain
- step:
name: Test
caches:
- maven
script:
- export TESTCONTAINERS_RYUK_DISABLED=true
- ./build.sh test
services:
- docker
我已经尝试过此处建议的补救措施:https://www.testcontainers.org/supported_docker_environment/continuous_integration/bitbucket_pipelines/
测试代码:
@Rule
public LocalStackContainer localstack = new LocalStackContainer( DockerImageName.parse("localstack/localstack:latest")).withServices(S3);
Localstack最初是Atlassian的一个开源项目,我想他们会对此提供一流的支持。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。