You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
π Analysis
The deserialization fails because Docker returns capabilities with the CAP_ prefix (e.g., CAP_DAC_READ_SEARCH), but the Capability enum in docker-java omits that prefix (e.g., DAC_READ_SEARCH).
According to the Docker capabilities documentation and types.go, Docker capabilities are typically listed with the CAP_ prefix.
OS: Ubuntu 22.04.5 LTS
Docker version: 28.1.0
Docker Compose version: v2.34.0
Docker-java version: 3.5.0
π Issue
When inspecting a Docker container using the docker-java client, I encounter the following exception:
π Example Code
π Analysis
The deserialization fails because Docker returns capabilities with the CAP_ prefix (e.g., CAP_DAC_READ_SEARCH), but the Capability enum in docker-java omits that prefix (e.g., DAC_READ_SEARCH).
According to the Docker capabilities documentation and types.go, Docker capabilities are typically listed with the CAP_ prefix.
The Capability enum here: https://javadoc.io/static/com.github.docker-java/docker-java/3.0.6/index.html?com/github/dockerjava/api/model/Capability.html
...does not align directly with the string values Docker returns.
β Suggested Fix
Could the enum Capability be enhanced to:
Support @JsonCreator to allow aliasing/deserialization of names with the CAP_ prefix?
Or alternatively, normalize the incoming capability strings before deserialization?
This would improve compatibility when parsing real-world Docker API responses, and prevent failures like the one above.
The text was updated successfully, but these errors were encountered: