diff --git a/internal/cli/banger.go b/internal/cli/banger.go index 606a773..dccda53 100644 --- a/internal/cli/banger.go +++ b/internal/cli/banger.go @@ -421,6 +421,21 @@ func runInternalMakeBundle(cmd *cobra.Command, opts internalMakeBundleOpts) erro return fmt.Errorf("flatten rootfs: %w", err) } + // docker create drops /.dockerenv (and containerd drops + // /run/.containerenv) into the container's writable layer, so + // `docker export` includes them in the tar. systemd-detect-virt + // reads those files and flags the boot as virtualization=docker, + // which disables udev device-unit activation (including the work- + // disk dev-vdb.device) and leaves systemd waiting forever. Strip + // them before building the ext4. + for _, marker := range []string{".dockerenv", "run/.containerenv"} { + path := filepath.Join(rootfsTree, marker) + if err := os.Remove(path); err != nil && !os.IsNotExist(err) { + return fmt.Errorf("strip %s: %w", marker, err) + } + delete(meta.Entries, marker) + } + if sizeBytes <= 0 { treeSize, err := dirSize(rootfsTree) if err != nil {