diff --git a/src/cmd/initContainer.go b/src/cmd/initContainer.go index a457cf3..222aa42 100644 --- a/src/cmd/initContainer.go +++ b/src/cmd/initContainer.go @@ -206,18 +206,6 @@ func initContainer(cmd *cobra.Command, args []string) error { return err } } - - for _, mount := range initContainerMounts { - if err := mountBind(mount.containerPath, mount.source, mount.flags); err != nil { - return err - } - } - - if utils.PathExists("/sys/fs/selinux") { - if err := mountBind("/sys/fs/selinux", "/usr/share/empty", ""); err != nil { - return err - } - } } if initContainerFlags.mediaLink { @@ -236,6 +224,18 @@ func initContainer(cmd *cobra.Command, args []string) error { } } + for _, mount := range initContainerMounts { + if err := mountBind(mount.containerPath, mount.source, mount.flags); err != nil { + return err + } + } + + if utils.PathExists("/sys/fs/selinux") { + if err := mountBind("/sys/fs/selinux", "/usr/share/empty", ""); err != nil { + return err + } + } + if _, err := user.Lookup(initContainerFlags.user); err != nil { if err := configureUsers(initContainerFlags.uid, initContainerFlags.user,