To create an install disk using an spare disk:

$ hdiutil create -size 6GB -fs JHFS+ -volname "macOS_installmedia" -type SPARSE ~/Desktop/macOS_installmedia

Mount it (or double-click in Finder to mount):

$ hdiutil mount ~/Desktop/macOS_installmedia.sparseimage

Use the createinstallmedia:

$ sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/macOS_installmedia --applicationpath /Applications/Install\ macOS\ High\ Sierra.app