-
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
base: main
Are you sure you want to change the base?
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 |
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.