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
containertool reads the architecture from the executable's ELF header and uses it to choose the correct base image manifest from a multi-arch base image (e.g. it will choose an aarch64 base image for an aarch64 executable).
It could be helpful to expand this to choose different default base images for statically- and dynamically-linked executables. The ELF reader would need to be improved to read the necessary information.
if the executable is statically linked, use DEFAULT_STATIC_BASE_IMAGE, which could be a distroless image.
if the executable is dynamically linked, use DEFAULT_DYNAMIC_BASE_IMAGE, which could be the current default of swift:slim
Going further, dynamic executables linked with --static-swift-stdlib could use a third default base image which provides the usual Linux dynamic libraries but does not include the Swift runtime, as this is not necessary.
This feature could be guarded behind a --automatic-base-image flag.