[Bug]: Switch docker-java transport to httpclient5 to avoid Java 24 warning

未關閉
#10,257 0 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
48/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
docker, java

研究方向

該 issue 確定了 Core 模組,但沒有指出檔案或測試。首先追蹤 Core 模組的 docker-java transport 相依性,並比較提議的 httpclient5 transport;完成的標準是 Java 24 不再發出 JNA restricted-access warning,同時現有的 Core 行為仍然正常運作。

由索引模型根據 Issue 內容生成。

描述

type/bug
Module

Core

Testcontainers version

1.20.6

Using the latest Testcontainers version?

Yes

Host OS

Win11 x64

Host Arch

x64

Docker version
Client:                                                                                                                                                                                   
 Version:           28.0.4                                                                                                                                                                
 API version:       1.48                                                                                                                                                                  
 Go version:        go1.23.7                                                                                                                                                              
 Git commit:        b8034c0                                                                                                                                                               
 Built:             Tue Mar 25 15:07:48 2025                                                                                                                                              
 OS/Arch:           windows/amd64                                                                                                                                                         
 Context:           desktop-linux                                                                                                                                                         
                                                                                                                                                                                          
Server: Docker Desktop 4.40.0 (187762)                                                                                                                                                    
 Engine:                                                                                                                                                                                  
  Version:          28.0.4                                                                                                                                                                
  API version:      1.48 (minimum version 1.24)                                                                                                                                           
  Go version:       go1.23.7                                                                                                                                                              
  Git commit:       6430e49                                                                                                                                                               
  Built:            Tue Mar 25 15:07:22 2025                                                                                                                                              
  OS/Arch:          linux/amd64                                                                                                                                                           
  Experimental:     false                                                                                                                                                                 
 containerd:                                                                                                                                                                              
  Version:          1.7.26                                                                                                                                                                
  GitCommit:        753481ec61c7c8955a23d6ff7bc8e4daed455734                                                                                                                              
 runc:                                                                                                                                                                                    
  Version:          1.2.5                                                                                                                                                                 
  GitCommit:        v1.2.5-0-g59923ef                                                                                                                                                     
 docker-init:                                                                                                                                                                             
  Version:          0.19.0                                                                                                                                                                
  GitCommit:        de40ad0
What happened?

When using Java 24, the JNA transitive dependency of the zerodep transport of docker-java produces the following message:

Short of requiring every user of testcontainers-java to add a JVM arg, there is no other option but to switch the docker-java transport to get rid of this warning. Httpclient5 would be a good candidate.

Relevant log output
WARNING: A restricted method in java.lang.System has been called                                                                                                                          
WARNING: java.lang.System::load has been called by com.sun.jna.Native in an unnamed module (file:/X:/gradle/caches/modules-2/files-2.1/net.java.dev.jna/jna/5.13.0/1200e7ebeedbe0d10062093f32925a912020e747/jna-5.13.0.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module                                                                                             
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
Additional Information
主要語言
Java
星號
8.8k
分支
2k
平均合併
2 天 1 小時
30 天內合併 PR
11

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

testcontainers/testcontainers-java 的其他 Issue

查看 testcontainers/testcontainers-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。