问题描述
在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 (将#修改为@)