To create CD ISO image of directories that contain long file name or non-8.3 format (particularly if you want to burn the CD image for use in Windows system), use the -J option switch that generates Joliet directory records in addition to regular iso9660 file names.
mkisofs -o MyDirectory.iso -J MyDirectory
mkisofs -o MyDirectory.iso -J MyDirectory