Attempting to automatically install a .DMG downloaded(of Docker), so that the host has access to docker run
etc. in Terminal.
I can attach the volume with no issue with:
curl -O https://download.docker.com/mac/stable/Docker.dmg > ./Docker.dmg
And then mount it:
hdiutil attach Docker.dmg
How do I step further from here and actually mock the "drag and drop to Applications" that will then be prompted to the user?
To my knowledge there is no .pkg inside this image. So I can't use the related question's answers(that were dubded as duplicate before, this question is more precise.)
Best Answer
Use this command once the .dmg is open to copy the app:
The user will get the usual pop-up security window when the app is first run:
You can further automate the process by ejecting the disk image:
Then opening the app to get the security warning: