<span>Error running Testcontainers Localstack(<a href="https://mvnrepository.com/artifact/org.testcontainers/localstack/1.15.0-rc2" target="_blank" rel="noopener nofollow noreferrer">https://mvnrepository.com/artifact/org.testcontainers/localstack/1.15.0-rc2</a>) in integration test.</span>
<span>It runs fine locally but fails in Bitbucket Pipelines</span>
Error:
<span>org.testcontainers.containers.ContainerLaunchException: Container startup failed<br><br></span><span>Caused by: org.testcontainers.containers.ContainerFetchException: Can't get Docker image: RemoteDockerImage(imageName=localstack/localstack:latest, imagePullPolicy=DefaultPullPolicy())<br><br></span><span>Caused by: com.github.dockerjava.api.exception.DockerException: </span><span>Status 403: {"message":"authorization denied by plugin pipelines: Invalid content length provided"}</span><span>Container startup failed<br><br></span>
pipelines.yml excerpt
definitions:
services:
docker:
memory: 2048
localstack:
image: localstack/localstack:latest
environment:
SERVICES: S3
LOCALSTACK_HOSTNAME: localhost
HOSTNAME: localhost
steps:
- parallel: &buildStepMain
- step:
name: Test M
caches:
- maven
script:
- export TESTCONTAINERS_RYUK_DISABLED=true
- ./build.sh test
services:
- docker
I already tried the remediations suggested here: https://www.testcontainers.org/supported_docker_environment/continuous_integration/bitbucket_pipelines/
Test code:
@Rule
public LocalStackContainer localstack = new LocalStackContainer( DockerImageName.parse("localstack/localstack:latest")).withServices(S3);
Localstack was an opensource project by Atlassian originally, I would think they would have first-class support for it.