Skip to content

Conversation

@dmcgowan
Copy link
Member

@dmcgowan dmcgowan commented Nov 1, 2024

Updates the os part of the format to include features after the os version. The guarantees that the format may fully represent the platform structure.

I propose we consider including the features in the format for 1.0 release, which we are trying to finalize.

Should we consider "/" or "+" as supported parts of OS features here? Right now the spec does not specify but we can define our own limitations. We could support it either by updating the parser (less backwards compatible) or URL encoding (ugly, but could be an edge case so who cares).

@tianon
Copy link
Member

tianon commented Nov 3, 2024

Does the format already support (non-OS) features?

(I don't think either are currently used for anything serious, but if we're going to support one we should probably support the other too.)

@dmcgowan
Copy link
Member Author

dmcgowan commented Nov 3, 2024

Does the format already support (non-OS) features?

Which format are you referring to?

In OCI there are non-OS features reserved, but not sure if that will ever be defined or added to the struct. I don't know where the line would be drawn in this case in regards to OS feature vs non-OS feature. It could be a hardware feature stuffed in as an OS feature, but what really is the difference if any hardware feature ends up being visible through the OS anyway. This is more for completeness of avoid compatibility later on when we want to add it, as had been previously discussed and recently inquired about.

@kzys
Copy link
Member

kzys commented Jan 10, 2025

The corresponding part in the spec is (I believe) https://github.com/opencontainers/image-spec/blob/92353b0bee778725c617e7d57317b568a7796bd0/image-index.md#image-index-property-descriptions

This OPTIONAL property specifies an array of strings, each specifying a mandatory OS feature.

@kzys
Copy link
Member

kzys commented Jan 10, 2025

Should we consider "/" or "+" as supported parts of OS features here?

I'd like to disallow them and I don't want to have URL-encoding later. Let me check with OCI folks.

@kzys
Copy link
Member

kzys commented Jan 11, 2025

Opened opencontainers/image-spec#1237

@dmcgowan dmcgowan marked this pull request as ready for review January 28, 2026 15:51
@dmcgowan
Copy link
Member Author

Marking this one as ready, OCI issue is there for discussion but the format is owned by containerd

@tianon
Copy link
Member

tianon commented Jan 28, 2026

As asked over in opencontainers/image-spec#1237, what's the use case? Is there a particular "feature" you're wanting to put in here / use?

platforms.go Outdated
if platform.OSVersion != "" {
OSAndVersion := fmt.Sprintf(osAndVersionFormat, platform.OS, platform.OSVersion)
osOptions := platform.OSVersion
for _, feature := range platform.OSFeatures {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we consider platforms to be equal if the features are in a different order?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be considered an unordered set, so yes. We can make the order deterministic here.

@dmcgowan
Copy link
Member Author

@tianon firstly to indicate support for erofs from the runtime and requirement for erofs support in the image

Updates the os part of the format to include features after the os
version. The guarantees that the format may fully represent the platform
structure.

Signed-off-by: Derek McGowan <derek@mcg.dev>
Ensure the formatting output is consistent

Signed-off-by: Derek McGowan <derek@mcg.dev>
@thaJeztah
Copy link
Member

Curious; was there a specific reason for using + as delimiter? Also considering that version strings could potentially include +. Or at least, I recall the discussions (distribution/distribution#1201) around people asking for + to be accepted for tags, e.g. 1.0.0+1 (which for sure is not "related", but to illustrate where version could contain +)

I recall when we were discussing the addition of os-version, that I considered ways to expand that; #6 (comment)

Could we make it support both to allow future-expansion that we cannot (yet) foresee? Considering;

windows([version=]<version>[,key=value[,key=value]])

So version would be the default key, and windows(<version>) would be the short-form for windows(version=<version>). Both would already be accepted, but short form would be the commonly used form (at least until additional options are to be added).

So if the value between () does not have a [key]=, then consider the value to be the default (version). Trailing commas should not be allowed (nor should (un-escaped?) = and . be accepted as part of key or value), and the comma to only be used if multiple key/value tuples are included.

One thing we should look at (and perhaps as part of the OCI?) is to define limits; I recall a discussion on our Slack where Docker Hub failed to process some images, because some tool (I think it was https://github.com/unikraft/kraftkit) used the os.features field in the spec to store their kernel config, and Docker hub had a limit of 255 chars for that field?

Unfortunately, I don't have a reference to that image itself, but I found the content of the field;

["CONFIG_ARCH_X86_64=y","CONFIG_CROSS_COMPILE=","CONFIG_DEBUG_SYMBOLS_LVL3=y","CONFIG_HAVE_APIC=y","CONFIG_HAVE_BOOTENTRY=y","CONFIG_HAVE_INTCTLR=y","CONFIG_HAVE_LIBC=y","CONFIG_HAVE_MMIO=y","CONFIG_HAVE_NW_STACK=y","CONFIG_HAVE_PCI=y","CONFIG_HAVE_SCHED=y","CONFIG_HAVE_TIME=y","CONFIG_HOST_ARCH=x86_64","CONFIG_HZ=100","CONFIG_KVM_BOOT_PROTO_MULTIBOOT=y","CONFIG_KVM_DEBUG_SERIAL_CONSOLE=y","CONFIG_KVM_DEBUG_VGA_CONSOLE=y","CONFIG_KVM_KERNEL_SERIAL_CONSOLE=y","CONFIG_KVM_KERNEL_VGA_CONSOLE=y","CONFIG_KVM_SERIAL_BAUD_115200=y","CONFIG_KVM_VMM_QEMU=y","CONFIG_LIBLWIP=y","CONFIG_LIBMUSL=y","CONFIG_LIBMUSL_AIO=y","CONFIG_LIBMUSL_CONF=y","CONFIG_LIBMUSL_CRYPT=y","CONFIG_LIBMUSL_CTYPE=y","CONFIG_LIBMUSL_DIRENT=y","CONFIG_LIBMUSL_ENV=y","CONFIG_LIBMUSL_ERRNO=y","CONFIG_LIBMUSL_EXIT=y","CONFIG_LIBMUSL_FCNTL=y","CONFIG_LIBMUSL_FENV=y","CONFIG_LIBMUSL_FORCE_THREAD=y","CONFIG_LIBMUSL_INTERNAL=y","CONFIG_LIBMUSL_IPC=y","CONFIG_LIBMUSL_LDSO=y","CONFIG_LIBMUSL_LEGACY=y","CONFIG_LIBMUSL_LINUX=y","CONFIG_LIBMUSL_LOCALE=y","CONFIG_LIBMUSL_LOCALE_LEGACY=y","CONFIG_LIBMUSL_MALLOC=y","CONFIG_LIBMUSL_MATH=y","CONFIG_LIBMUSL_MISC=y","CONFIG_LIBMUSL_MMAN=y","CONFIG_LIBMUSL_MQ=y","CONFIG_LIBMUSL_MULTIBYTE=y","CONFIG_LIBMUSL_NETWORK=y","CONFIG_LIBMUSL_PASSWD=y","CONFIG_LIBMUSL_PRNG=y","CONFIG_LIBMUSL_PROCESS=y","CONFIG_LIBMUSL_REGEX=y","CONFIG_LIBMUSL_SCHED=y","CONFIG_LIBMUSL_SEARCH=y","CONFIG_LIBMUSL_SELECT=y","CONFIG_LIBMUSL_SETJMP=y","CONFIG_LIBMUSL_SIGNAL=y","CONFIG_LIBMUSL_STAT=y","CONFIG_LIBMUSL_STDIO=y","CONFIG_LIBMUSL_STDLIB=y","CONFIG_LIBMUSL_STRING=y","CONFIG_LIBMUSL_TEMP=y","CONFIG_LIBMUSL_TERMIOS=y","CONFIG_LIBMUSL_THREAD=y","CONFIG_LIBMUSL_TIME=y","CONFIG_LIBMUSL_UNISTD=y","CONFIG_LIBNGINX=y","CONFIG_LIBNGINX_HTTP=y","CONFIG_LIBNGINX_HTTP_ACCESS=y","CONFIG_LIBNGINX_HTTP_AUTOINDEX=y","CONFIG_LIBNGINX_HTTP_BROWSER=y","CONFIG_LIBNGINX_HTTP_CHARSET=y","CONFIG_LIBNGINX_HTTP_EMPTY_GIF=y","CONFIG_LIBNGINX_HTTP_FASTCGI=y","CONFIG_LIBNGINX_HTTP_GEO=y","CONFIG_LIBNGINX_HTTP_GRPC=y","CONFIG_LIBNGINX_HTTP_LIMIT_CONN=y","CONFIG_LIBNGINX_HTTP_LIMIT_REQ=y","CONFIG_LIBNGINX_HTTP_MAP=y","CONFIG_LIBNGINX_HTTP_MEMCACHED=y","CONFIG_LIBNGINX_HTTP_MIRROR=y","CONFIG_LIBNGINX_HTTP_POSTPONE=y","CONFIG_LIBNGINX_HTTP_PROXY=y","CONFIG_LIBNGINX_HTTP_REFERER=y","CONFIG_LIBNGINX_HTTP_SCGI=y","CONFIG_LIBNGINX_HTTP_SPLIT_CLIENTS=y","CONFIG_LIBNGINX_HTTP_SSI=y","CONFIG_LIBNGINX_HTTP_STUB_STATUS=y","CONFIG_LIBNGINX_HTTP_UPSTREAM=y","CONFIG_LIBNGINX_HTTP_UPSTREAM_HASH=y","CONFIG_LIBNGINX_HTTP_UPSTREAM_IP_HASH=y","CONFIG_LIBNGINX_HTTP_UPSTREAM_KEEPALIVE=y","CONFIG_LIBNGINX_HTTP_UPSTREAM_LEAST_CONN=y","CONFIG_LIBNGINX_HTTP_UPSTREAM_RANDOM=y","CONFIG_LIBNGINX_HTTP_UPSTREAM_ZONE=y","CONFIG_LIBNGINX_HTTP_USERID=y","CONFIG_LIBNGINX_HTTP_UWSGI=y","CONFIG_LIBNGINX_HTTP_V2=y","CONFIG_LIBNGINX_MAIN_FUNCTION=y","CONFIG_LIBPOSIX_ENVIRON=y","CONFIG_LIBPOSIX_ENVIRON_ENVP0=PATH=/bin","CONFIG_LIBPOSIX_ENVIRON_ENVP0_NOTEMPTY=y","CONFIG_LIBPOSIX_ENVIRON_ENVP10=","CONFIG_LIBPOSIX_ENVIRON_ENVP11=","CONFIG_LIBPOSIX_ENVIRON_ENVP12=","CONFIG_LIBPOSIX_ENVIRON_ENVP13=","CONFIG_LIBPOSIX_ENVIRON_ENVP14=","CONFIG_LIBPOSIX_ENVIRON_ENVP15=","CONFIG_LIBPOSIX_ENVIRON_ENVP1=","CONFIG_LIBPOSIX_ENVIRON_ENVP2=","CONFIG_LIBPOSIX_ENVIRON_ENVP3=","CONFIG_LIBPOSIX_ENVIRON_ENVP4=","CONFIG_LIBPOSIX_ENVIRON_ENVP5=","CONFIG_LIBPOSIX_ENVIRON_ENVP6=","CONFIG_LIBPOSIX_ENVIRON_ENVP7=","CONFIG_LIBPOSIX_ENVIRON_ENVP8=","CONFIG_LIBPOSIX_ENVIRON_ENVP9=","CONFIG_LIBPOSIX_EVENT=y","CONFIG_LIBPOSIX_FUTEX=y","CONFIG_LIBPOSIX_LIBDL=y","CONFIG_LIBPOSIX_PROCESS=y","CONFIG_LIBPOSIX_PROCESS_CLONE=y","CONFIG_LIBPOSIX_PROCESS_INIT_PIDS=y","CONFIG_LIBPOSIX_PROCESS_MAX_PID=31","CONFIG_LIBPOSIX_PROCESS_PIDS=y","CONFIG_LIBPOSIX_SOCKET=y","CONFIG_LIBPOSIX_SYSINFO=y","CONFIG_LIBPOSIX_TIME=y","CONFIG_LIBPOSIX_USER=y","CONFIG_LIBPOSIX_USER_GID=0","CONFIG_LIBPOSIX_USER_GROUPNAME=root","CONFIG_LIBPOSIX_USER_UID=0","CONFIG_LIBPOSIX_USER_USERNAME=root","CONFIG_LIBRAMFS=y","CONFIG_LIBSYSCALL_SHIM=y","CONFIG_LIBSYSCALL_SHIM_LEGACY_VERBOSE=y","CONFIG_LIBSYSCALL_SHIM_NOWRAPPER=y","CONFIG_LIBUKALLOC=y","CONFIG_LIBUKALLOCBBUDDY=y","CONFIG_LIBUKARGPARSE=y","CONFIG_LIBUKBOOT=y","CONFIG_LIBUKBOOT_BANNER_POWEREDBY=y","CONFIG_LIBUKBOOT_INITBBUDDY=y","CONFIG_LIBUKBOOT_INITSCHEDCOOP=y","CONFIG_LIBUKBOOT_MAXNBARGS=60","CONFIG_LIBUKBUS=y","CONFIG_LIBUKBUS_PCI=y","CONFIG_LIBUKBUS_PLATFORM=y","CONFIG_LIBUKCPIO=y","CONFIG_LIBUKDEBUG=y","CONFIG_LIBUKDEBUG_ENABLE_ASSERT=y","CONFIG_LIBUKDEBUG_PRINTK=y","CONFIG_LIBUKDEBUG_PRINTK_ERR=y","CONFIG_LIBUKDEBUG_PRINT_SRCNAME=y","CONFIG_LIBUKDEBUG_PRINT_TIME=y","CONFIG_LIBUKDEBUG_REDIR_PRINTD=y","CONFIG_LIBUKINTCTLR=y","CONFIG_LIBUKINTCTLR_MAX_HANDLERS_PER_IRQ=8","CONFIG_LIBUKINTCTLR_XPIC=y","CONFIG_LIBUKLIBID=y","CONFIG_LIBUKLIBID_INFO=y","CONFIG_LIBUKLIBID_INFO_COMPILEDATE=y","CONFIG_LIBUKLIBID_INFO_LIB_COMPILER=y","CONFIG_LIBUKLIBID_INFO_UKFULLVERSION=y","CONFIG_LIBUKLIBPARAM=y","CONFIG_LIBUKLOCK=y","CONFIG_LIBUKLOCK_MUTEX=y","CONFIG_LIBUKLOCK_RWLOCK=y","CONFIG_LIBUKLOCK_SEMAPHORE=y","CONFIG_LIBUKMMAP=y","CONFIG_LIBUKMPI=y","CONFIG_LIBUKMPI_MBOX=y","CONFIG_LIBUKNETDEV=y","CONFIG_LIBUKNETDEV_DISPATCHERTHREADS=y","CONFIG_LIBUKNETDEV_MAXNBQUEUES=1","CONFIG_LIBUKSCHED=y","CONFIG_LIBUKSCHEDCOOP=y","CONFIG_LIBUKSCHED_TCB_INIT=y","CONFIG_LIBUKSGLIST=y","CONFIG_LIBUKSIGNAL=y","CONFIG_LIBUKSTREAMBUF=y","CONFIG_LIBUKSWRAND=y","CONFIG_LIBUKSWRAND_CHACHA=y","CONFIG_LIBUKSWRAND_INITIALSEED_TIME=y","CONFIG_LIBUKTIMECONV=y","CONFIG_LIBVFSCORE=y","CONFIG_LIBVFSCORE_AUTOMOUNT_ROOTFS=y","CONFIG_LIBVFSCORE_PIPE_SIZE_ORDER=16","CONFIG_LIBVFSCORE_ROOTFS=initrd","CONFIG_LIBVFSCORE_ROOTFS_INITRD=y","CONFIG_LIBVIRTIO_BUS=y","CONFIG_LIBVIRTIO_MMIO=y","CONFIG_LIBVIRTIO_NET=y","CONFIG_LIBVIRTIO_PCI=y","CONFIG_LIBVIRTIO_RING=y","CONFIG_LLVM_TARGET_ARCH=","CONFIG_LWIP_AUTOIFACE=y","CONFIG_LWIP_DHCP=y","CONFIG_LWIP_DNS=y","CONFIG_LWIP_DNS_MAX_SERVERS=2","CONFIG_LWIP_DNS_TABLE_SIZE=32","CONFIG_LWIP_HEAP=y","CONFIG_LWIP_ICMP=y","CONFIG_LWIP_IPV4=y","CONFIG_LWIP_IP_REASS_MAX_PBUFS=10","CONFIG_LWIP_LOOPBACK=y","CONFIG_LWIP_NETIF_EXT_STATUS_CALLBACK=y","CONFIG_LWIP_NETIF_STATUS_PRINT=y","CONFIG_LWIP_NUM_TCPCON=64","CONFIG_LWIP_NUM_TCPLISTENERS=64","CONFIG_LWIP_SOCKET=y","CONFIG_LWIP_STACKTHREAD_MBOX_SIZE=256","CONFIG_LWIP_STACKTHREAD_MBOX_SIZE_256=y","CONFIG_LWIP_TCP=y","CONFIG_LWIP_TCP_KEEPALIVE=y","CONFIG_LWIP_TCP_MSS=1460","CONFIG_LWIP_TCP_RECVMBOX_FACTOR=2","CONFIG_LWIP_THREADS=y","CONFIG_LWIP_UDP=y","CONFIG_LWIP_UDP_RECVMBOX_FACTOR=2","CONFIG_LWIP_UKNETDEV=y","CONFIG_LWIP_UKNETDEV_SCRATCH=64","CONFIG_LWIP_UNIKRAFT21X=y","CONFIG_LWIP_WND_SCALE=y","CONFIG_MARCH_X86_64_GENERIC=y","CONFIG_OPTIMIZE_COMPRESS=y","CONFIG_OPTIMIZE_NOOMITFP=y","CONFIG_OPTIMIZE_PERF=y","CONFIG_PLAT_KVM=y","CONFIG_STACK_SIZE_PAGE_ORDER=4","CONFIG_UKPLAT_LCPU_MAXCOUNT=1","CONFIG_UKPLAT_MEMREGION_MAX_COUNT=128","CONFIG_UK_ARCH=x86_64","CONFIG_UK_CODENAME=Pandora","CONFIG_UK_DEFNAME=nginx-qemu-x86_64-initrd","CONFIG_UK_FULLVERSION=0.15.0~fb9fdf3","CONFIG_UK_NAME=nginx","CONFIG_VIRTIO_DEVICE=y","CONFIG_VIRTIO_MMIO_MAX_DEV_CMDLINE=4"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants