diff --git a/Dockerfile b/Dockerfile index 9457279614..7dc391ba82 100644 --- a/Dockerfile +++ b/Dockerfile @@ -760,6 +760,7 @@ RUN < /rootfs/usr/etc/in-container RUN find /rootfs -print0 \ | xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}" diff --git a/internal/app/machined/pkg/runtime/v1alpha1/platform/platform.go b/internal/app/machined/pkg/runtime/v1alpha1/platform/platform.go index 1a74eed1f5..073542edfa 100644 --- a/internal/app/machined/pkg/runtime/v1alpha1/platform/platform.go +++ b/internal/app/machined/pkg/runtime/v1alpha1/platform/platform.go @@ -67,6 +67,10 @@ const ( // CurrentPlatform is a helper func for discovering the current platform. func CurrentPlatform() (p runtime.Platform, err error) { + if _, err := os.Stat("/usr/etc/in-container"); err == nil { + return newPlatform("container") + } + var platform string if p := procfs.ProcCmdline().Get(constants.KernelParamPlatform).First(); p != nil {