I face this error when try to run bitbucket pipelines with test container
Could not start container java.lang.IllegalStateException: Container did not start correctly.
There is no another issues but maybe it's related to Binds? Logs:
"HostConfig":"Binds":["/opt/atlassian/pipelines/agent/build/src/test/resources:/opt/atlassian/pipelines/agent/build/src/test/resources:rw","/var/run/docker.sock:/docker.sock:rw"]
Pipelines config:
pipelines:
pull-requests:
'**':
- step:
name: Integration tests
caches:
- maven
after-script:
- pipe: atlassian/checkstyle-report:0.3.0
script:
- export TESTCONTAINERS_RYUK_DISABLED=true
- export TESTCONTAINERS_CHECKS_DISABLE=true
- mvn -B verify -Dsurefire.skip=true --file pom.xml
services:
- docker
- step:
name: Build
caches:
- maven
after-script:
- pipe: atlassian/checkstyle-report:0.3.0
script:
- mvn -B package --file pom.xml -DskipTests
services:
- docker
definitions:
services:
docker:
memory: 3072
docker-compose.yml
services:
db:
image: postgres:14.1
ports:
- "5432:5432"
expose:
- "5432"
networks:
- example-network
environment:
- "POSTGRES_USER=${DB_USER:-postgres}"
- "POSTGRES_PASSWORD=${DB_PASSWORD:-postgres}"
- "POSTGRES_DB=${DB_SCHEMA:-testdb}"
logging:
driver: json-file
options:
mode: "non-blocking"
networks:
example-network:
driver: bridge
docker compose container:
DOCKER_COMPOSE_CONTAINER =
new DockerComposeContainer(new File("src/test/resources/docker-compose.yml"))
.withExposedService(SERVICE_NAME, SERVICE_PORT,
Wait.forListeningPort());
DOCKER_COMPOSE_CONTAINER.start();
I also tried without TESTCONTAINERS_CHECKS_DISABLE=true but there was error like
Status 403: {"message":"authorization denied by plugin pipelines: -v only supports $BITBUCKET_CLONE_DIR and its subdirectories"}
Could anyone help with this please?