testcontainers / testcontainers/testcontainers-java

Testcontainers doesn't start the nested containers from a pod on AKS running Podman

Open
#5,475 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

client/podman
Dominant language
Java
Stars
8.7k
Forks
1.9k
Avg merge
2d 17h
Merged PRs (30d)
9

Description

Hi team,
Trying to use TestContainers with Podman inside of a pod on AKS. Unfortunately, it fails to start any of the nested containers. Any idea how we can make this work?

Environment:
A pod running on AKS with the below image

FROM jenkins/inbound-agent:latest-alpine
USER root
RUN apk add podman

Testcontainers to run:

public class ElasticsearchContainerInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext>, Ordered {
    private static final String DEFAULT_TAG = "6.5.0";
    private static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName
          .parse("docker.elastic.co/elasticsearch/elasticsearch")
          .withTag(DEFAULT_TAG);
    private static final ElasticsearchContainer ELASTICSEARCH_CONTAINER;
    static {
        ELASTICSEARCH_CONTAINER = new ElasticsearchContainer(DEFAULT_IMAGE_NAME);
        ELASTICSEARCH_CONTAINER.start();
    }

    public void initialize(ConfigurableApplicationContext configurableApplicationContext) {
        TestPropertyValues.of(
              "app.resources.elasticsearch.port=" + ELASTICSEARCH_CONTAINER.getMappedPort(9200),
              "app.resources.elasticsearch.host=" + ELASTICSEARCH_CONTAINER.getContainerIpAddress()
        ).applyTo(configurableApplicationContext.getEnvironment());
    }

    @Override
    public int getOrder() {
        return 0;
    }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report provides an AKS pod setup using Podman and an ElasticsearchContainerInitializer, but no repository file, failing test, or error output. Start by reproducing the nested-container failure in that environment; done means the Elasticsearch container starts successfully and its mapped host and port are available to the application.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, java, kubernetes
Domain
cloud, infrastructure, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.