-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Annotations option added to hostconfig #2422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi, thanks for your contribution. Can you add a test, please? |
@eddumelendez test is added |
thanks! test is failing |
@eddumelendez trying to figure out why it fails. It seems to be that annotations is properly added to hostconfig, and while creating container debug logs shows annotations are added to hosthostconfig. 12:32:39.416 DEBUG c.g.d.core.command.AbstrDockerCmd - Cmd: com.github.dockerjava.core.command.CreateContainerCmdImpl@113dcaf8[aliases=,argsEscaped=,attachStderr=,attachStdin=,attachStdout=,authConfig=AuthConfig(username=githubactions, email=null, registryAddress=https://index.docker.io/v1/, stackOrchestrator=null),cmd={sleep,9999},domainName=,entrypoint=,env=,exposedPorts=ExposedPorts(exposedPorts=[]),healthcheck=,hostConfig=HostConfig(binds=[], blkioWeight=null, blkioWeightDevice=null, blkioDeviceReadBps=null, blkioDeviceWriteBps=null, blkioDeviceReadIOps=null, blkioDeviceWriteIOps=null, memorySwappiness=null, nanoCPUs=null, annotations={com.example.key2=value2, com.example.key1=value1}, capAdd=null, capDrop=null, containerIDFile=null, cpuPeriod=null, cpuRealtimePeriod=null, cpuRealtimeRuntime=null, cpuShares=null, cpuQuota=null, cpusetCpus=null, cpusetMems=null, devices=null, deviceCgroupRules=null, deviceRequests=null, diskQuota=null, dns=null, dnsOptions=null, dnsSearch=null, extraHosts=null, groupAdd=null, ipcMode=null, cgroup=null, links=[], logConfig=LogConfig(type=null, config=null), lxcConf=null, memory=null, memorySwap=null, memoryReservation=null, kernelMemory=null, networkMode=null, oomKillDisable=null, init=null, autoRemove=null, oomScoreAdj=null, portBindings=null, privileged=null, publishAllPorts=null, readonlyRootfs=null, restartPolicy=null, ulimits=null, cpuCount=null, cpuPercent=null, ioMaximumIOps=null, ioMaximumBandwidth=null, volumesFrom=null, mounts=null, pidMode=null, isolation=null, securityOpts=null, storageOpt=null, cgroupParent=null, volumeDriver=null, shmSize=null, pidsLimit=null, runtime=null, tmpFs=null, utSMode=null, usernsMode=null, sysctls=null, consoleSize=null, cgroupnsMode=null),hostName=,image=busybox:latest,ipv4Address=,ipv6Address=,labels=,macAddress=,name=,networkDisabled=,networkingConfig=,onBuild=,platform=,portSpecs=,shell=,stdInOnce=,stdinOpen=,stopSignal=,stopTimeout=,tty=,user=,volumes=Volumes(volumes=[]),workingDir=] but container is not created with annotations on the host config therefore inspect response return annotations as null: 14:24:00.202 INFO c.g.d.cmd.CreateContainerCmdIT - Container inspection response: InspectContainerResponse(args=[9999], config=ContainerConfig(attachStderr=false, attachStdin=false, attachStdout=false, cmd=[sleep, 9999], domainName=, entrypoint=null, env=[PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin], exposedPorts=null, hostName=8ace52143836, image=busybox:latest, labels={}, macAddress=null, networkDisabled=null, onBuild=null, stdinOpen=false, portSpecs=null, stdInOnce=false, tty=false, user=, volumes=null, workingDir=, healthCheck=null), created=2025-05-13T14:24:00.187078736Z, driver=overlay2, execDriver=null, hostConfig=HostConfig(binds=[], blkioWeight=0, blkioWeightDevice=null, blkioDeviceReadBps=null, blkioDeviceWriteBps=null, blkioDeviceReadIOps=null, blkioDeviceWriteIOps=null, memorySwappiness=null, nanoCPUs=0, annotations=null, capAdd=null, capDrop=null, containerIDFile=, cpuPeriod=0, cpuRealtimePeriod=0, cpuRealtimeRuntime=0, cpuShares=0, cpuQuota=0, cpusetCpus=, cpusetMems=, dev |
looks like annotations are set building images not containers. See https://docs.docker.com/build/metadata/annotations/ So, I think we can close this one |
nope annotation are also added to hostconfig since api version 1.43. curl -X POST curl -X GET |
@eddumelendez I just realized that the reason test was failed is due to default client for test use older api version. I fixed the test case. here is my local test results. |
Thanks for you contribution, @emirhandurmus ! |
| Package | Type | Package file | Manager | Update | Change | |---|---|---|---|---|---| | [com.github.docker-java:docker-java-transport-httpclient5](https://github.com/docker-java/docker-java) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `3.5.2` -> `3.5.3` | | [com.github.docker-java:docker-java-transport](https://github.com/docker-java/docker-java) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `3.5.2` -> `3.5.3` | | [com.github.docker-java:docker-java-core](https://github.com/docker-java/docker-java) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `3.5.2` -> `3.5.3` | | [com.github.docker-java:docker-java-api](https://github.com/docker-java/docker-java) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `3.5.2` -> `3.5.3` | | [com.github.docker-java:docker-java](https://github.com/docker-java/docker-java) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `3.5.2` -> `3.5.3` | --- ### Release Notes <details> <summary>docker-java/docker-java (com.github.docker-java:docker-java-transport-httpclient5)</summary> ### [`v3.5.3`](https://github.com/docker-java/docker-java/releases/tag/3.5.3) [Compare Source](docker-java/docker-java@3.5.2...3.5.3) ##### Changes - Bump jackson.version from 2.18.3 to 2.18.4 [@​dependabot](https://github.com/dependabot) ([#​2473](docker-java/docker-java#2473)) - Drop jackson-jaxrs-json-provider dependency [@​eddumelendez](https://github.com/eddumelendez) ([#​2468](docker-java/docker-java#2468)) - Bump org.testcontainers:testcontainers from 1.21.2 to 1.21.3 [@​dependabot](https://github.com/dependabot) ([#​2467](docker-java/docker-java#2467)) - Bump commons-io:commons-io from 2.18.0 to 2.19.0 [@​dependabot](https://github.com/dependabot) ([#​2428](docker-java/docker-java#2428)) - Bump netty.version from 4.1.119.Final to 4.2.2.Final [@​dependabot](https://github.com/dependabot) ([#​2454](docker-java/docker-java#2454)) - Bump org.apache.httpcomponents.client5:httpclient5 from 5.4.4 to 5.5 [@​dependabot](https://github.com/dependabot) ([#​2445](docker-java/docker-java#2445)) ##### 📈 Enhancements - Annotations option added to hostconfig [@​emirhandurmus](https://github.com/emirhandurmus) ([#​2422](docker-java/docker-java#2422)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 6pm every weekday,before 2am every weekday" in timezone Australia/Melbourne, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Never, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). GitOrigin-RevId: a6ed07fba1bfcc1f48eed708427db745d4823318
Annotations opptions added to Hostconfig.
When users choose crun rather than runc and would like to deploy wasm containers, they need to provide annotations on hostconfig.