Skip to content

[Bug]: VaultContainer doesn't work on GitLab #6623

@mvmn

Description

@mvmn

Module

Vault

Testcontainers version

1.17.6

Using the latest Testcontainers version?

Yes

Host OS

Linux

Host Arch

x86

Docker version

20.10.18

What happened?

Vault container startup fails in Bitbucket Pipelines. Cap add is forbidden in Bitbucket Pipelines - but VaultContainer uses the deprecated api to set --cap-add via create container command modifier:
withCreateContainerCmdModifier(cmd -> cmd.withCapAdd(Capability.IPC_LOCK)); (see line 58 here - https://github.com/testcontainers/testcontainers-java/blob/main/modules/vault/src/main/java/org/testcontainers/vault/VaultContainer.java )

And there is no possibility to override this.

Relevant log output

[Test worker] INFO  🐳 [vault:1.12.2] - Creating container for image: vault:1.12.2
[Test worker] ERROR 🐳 [vault:1.12.2] - Could not start container
    com.github.dockerjava.api.exception.DockerException: Status 403: {"message":"authorization denied by plugin pipelines: --cap-add is not allowed"}

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions