Title: Docker Swarm Service Container : Capability prefixed with CAP_ cannot be deserialized (InvalidFormatException) · Issue #1980 · docker-java/docker-java · GitHub
Open Graph Title: Docker Swarm Service Container : Capability prefixed with CAP_ cannot be deserialized (InvalidFormatException) · Issue #1980 · docker-java/docker-java
X Title: Docker Swarm Service Container : Capability prefixed with CAP_ cannot be deserialized (InvalidFormatException) · Issue #1980 · docker-java/docker-java
Description: Docker: version 20.10.18, build b40c2f6 docker-java:3.2.8 Description We have a service deployed to a Docker Swarm, using docker-compose to set the IPC_LOCK capability, as follows: services: myService: image: myImage cap_add: - IPC_LOCK ...
Open Graph Description: Docker: version 20.10.18, build b40c2f6 docker-java:3.2.8 Description We have a service deployed to a Docker Swarm, using docker-compose to set the IPC_LOCK capability, as follows: services: myServ...
X Description: Docker: version 20.10.18, build b40c2f6 docker-java:3.2.8 Description We have a service deployed to a Docker Swarm, using docker-compose to set the IPC_LOCK capability, as follows: services: myServ...
Opengraph URL: https://github.com/docker-java/docker-java/issues/1980
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Docker Swarm Service Container : Capability prefixed with CAP_ cannot be deserialized (InvalidFormatException)","articleBody":"Docker: version 20.10.18, build b40c2f6\r\ndocker-java:3.2.8\r\n\r\n**Description**\r\nWe have a service deployed to a Docker Swarm, using docker-compose to set the IPC_LOCK capability, as follows:\r\n\r\n```\r\nservices:\r\n myService:\r\n image: myImage\r\n cap_add:\r\n - IPC_LOCK\r\n```\r\n\r\nCalling the docker-java `InspectContainerCmdImpl` to inspect the container on the node to which the service task has been deployed fails and produces the following exception:\r\n\r\n```\r\n2022-10-11T14:40:41.800756150Z java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `com.github.dockerjava.api.model.Capability` from String \"CAP_IPC_LOCK\": value not one of declared Enum instance names: [ALL, SYS_BOOT, DAC_OVERRIDE, NET_RAW, BLOCK_SUSPEND, FOWNER, IPC_LOCK, IPC_OWNER, SYS_PACCT, NET_BIND_SERVICE, WAKE_ALARM, FSETID, DAC_READ_SEARCH, SYS_CHROOT, SYS_RAWIO, SYS_ADMIN, KILL, MAC_ADMIN, SYS_RESOURCE, CHOWN, SETPCAP, SYS_PTRACE, NET_ADMIN, SETFCAP, SYS_NICE, LINUX_IMMUTABLE, AUDIT_CONTROL, LEASE, AUDIT_WRITE, SYS_MODULE, MKNOD, SYSLOG, MAC_OVERRIDE, SYS_TIME, SETGID, SETUID, SYS_TTY_CONFIG, NET_BROADCAST]\r\n2022-10-11T14:40:41.800761129Z at [Source: (com.github.dockerjava.core.DefaultInvocationBuilder$2); line: 1, column: 2062] (through reference chain: com.github.dockerjava.api.command.InspectContainerResponse[\"HostConfig\"]-\u003ecom.github.dockerjava.api.model.HostConfig[\"CapAdd\"]-\u003ejava.lang.Object[][0])\r\n2022-10-11T14:40:41.800784357Z \tat com.github.dockerjava.core.DefaultInvocationBuilder.get(DefaultInvocationBuilder.java:77) ~[docker-java-core-3.2.8.jar!/:na]\r\n2022-10-11T14:40:41.800787901Z \tat com.github.dockerjava.core.exec.InspectContainerCmdExec.execute(InspectContainerCmdExec.java:31) ~[docker-java-core-3.2.8.jar!/:na]\r\n2022-10-11T14:40:41.800792420Z \tat com.github.dockerjava.core.exec.InspectContainerCmdExec.execute(InspectContainerCmdExec.java:13) ~[docker-java-core-3.2.8.jar!/:na]\r\n2022-10-11T14:40:41.800795370Z \tat com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21) ~[docker-java-core-3.2.8.jar!/:na]\r\n2022-10-11T14:40:41.800798829Z \tat com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35) ~[docker-java-core-3.2.8.jar!/:na]\r\n2022-10-11T14:40:41.800802249Z \tat com.github.dockerjava.core.command.InspectContainerCmdImpl.exec(InspectContainerCmdImpl.java:52) ~[docker-java-core-3.2.8.jar!/:na]\r\n```\r\n\r\nBased on the documentation, Docker uses a capability name with/without the CAP_ prefix interchangeably:\r\nhttps://docs.docker.com/engine/reference/run/\r\n\r\n\u003e The --cap-add and --cap-drop flags accept capabilities to be specified with a CAP_ prefix. The following examples are therefore equivalent:\r\n\u003e docker run --cap-add=SYS_ADMIN ...\r\n\u003e docker run --cap-add=CAP_SYS_ADMIN ...\r\n\r\nThis does not appear to be a Docker / Docker swarm bug. Can the CAP_ prefix be automatically stripped to prevent the deserialization issue?\r\n\r\nThanks\r\n\r\n","author":{"url":"https://github.com/armband","@type":"Person","name":"armband"},"datePublished":"2022-10-13T13:58:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/1980/docker-java/issues/1980"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:77b77d46-6b44-3db6-5e34-a27cfdaa7707 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B18A:B8167:260D366:34A56BC:6972992C |
| html-safe-nonce | c4f8c88b3e665827f8c2cc08395a800482f87aac8e4bfc55a693ab26def905c7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMThBOkI4MTY3OjI2MEQzNjY6MzRBNTZCQzo2OTcyOTkyQyIsInZpc2l0b3JfaWQiOiI0NzcxMjQ1NjAxNDMxMTMyNDYwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4f997e8973056e618486cb46ebcafed5df939938d2ee618a45a44adfb8e647e1 |
| hovercard-subject-tag | issue:1407857464 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/docker-java/docker-java/1980/issue_layout |
| twitter:image | https://opengraph.githubassets.com/35a5862e2c505d911ab93fb987afc7b82e3dbefe6a5e5a341a9e1ec954edf979/docker-java/docker-java/issues/1980 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/35a5862e2c505d911ab93fb987afc7b82e3dbefe6a5e5a341a9e1ec954edf979/docker-java/docker-java/issues/1980 |
| og:image:alt | Docker: version 20.10.18, build b40c2f6 docker-java:3.2.8 Description We have a service deployed to a Docker Swarm, using docker-compose to set the IPC_LOCK capability, as follows: services: myServ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | armband |
| hostname | github.com |
| expected-hostname | github.com |
| None | 72bb1c46bb1ebdc0dc83a0a57b64c3b4d668c125d1125d94898213a4c9db8da2 |
| turbo-cache-control | no-preview |
| go-import | github.com/docker-java/docker-java git https://github.com/docker-java/docker-java.git |
| octolytics-dimension-user_id | 7772003 |
| octolytics-dimension-user_login | docker-java |
| octolytics-dimension-repository_id | 20415251 |
| octolytics-dimension-repository_nwo | docker-java/docker-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20415251 |
| octolytics-dimension-repository_network_root_nwo | docker-java/docker-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7b2326416cb9f2fa4ab7b6ede33ad46d0dd431a1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width