private OsType determineOsType ( String imageId ) { InspectImageResponse ir = getClient ( ) . inspectImageCmd ( imageId ) . exec ( ) ; if ( "linux" . equalsIgnoreCase ( ir . getOs ( ) ) ) { LOG . trace ( "Detected LINUX operating system for image: {}" , imageId ) ; return OsType . LINUX ; } else if ( "windows" . equalsIgnoreCase ( ir . getOs ( ) ) ) { LOG . trace ( "Detected WINDOWS operating system for image: {}" , imageId ) ; return OsType . WINDOWS ; } else { LOG . trace ( "Detected OTHER operating system ({}) for image: {}" , ir . getOs ( ) , imageId ) ; return OsType . OTHER ; } }
Determine the operating system associated with an image .