testcontainers / testcontainers/testcontainers-java

[Bug]: Doesn't work behind proxy since 1.20.0 (1.20.1 too)

Open
#9,141 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Module

Core

Testcontainers version

1.20.0

Using the latest Testcontainers version?

Yes

Host OS

Linux OL8

Host Arch

x86

Docker version
20.10.21
What happened?

When we upgrade the testcontainers version from 1.19.8 to 1.20.* our container (oracle free database) doesn't start anymore.

We usually use the docker image from Oracle container registry like this :

    private static final DockerImageName oracleFreeImage = DockerImageName
            .parse("container-registry.oracle.com/database/free:23.3.0.0")
            .asCompatibleSubstituteFor("gvenzl/oracle-free");

We tried without success to use the one from testcontainers :

    public static OracleContainer oracleContainer = new OracleContainer("gvenzl/oracle-free:23.4-slim-faststart")

The behaviour is always the same in Jenkins (maven 3.6.2) :

[ERROR]   MyTestClass.theTest » NoClassDefFound

It works perfectly on local machine (Windows 10, maven 3.6.2).

The Jenkins jobs runs on OL8 machine behind an enterprise proxy. The credentials are configured in

/etc/systemd/system/docker.service.d/http-proxy.conf

like that

[Service]
Environment="HTTP_PROXY=http://myuser:mypwd@proxy.mycompany.com:3128"
Environment="HTTPS_PROXY=http://myuser:mypwd@proxy.mycompany.com:3128"
Environment="NO_PROXY=localhost,127.0.0.0/8,mycompany.com,local"

This was working with 1.19.8 and 1.19.7.

I tried to force environment variables with .withEnv("HTTP_PROXY... It had no effect.

I guess this bug comes from a dependency but I didn't manage to find which incriminate.

I can help to run any workaround if you need me.

Regards

Relevant log output
unfortunately nothing
Additional Information

No response

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

Reproduce the upgrade from 1.19.8 to 1.20.x in the Jenkins environment described, using the Oracle container and configured proxy. Compare the dependency behavior between versions and confirm the fix by starting the container successfully behind the proxy.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java
Domain
devops, testing-qa
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.