I suppose you could do that in AppleScript by writing something like
Tell application "Finder"
eject "DiskName"
End tell
then compile it as an applet and put it on the dock with a custom icon that corresponds to the hard drive.
I've tried this once with my external drive and it seems to work fine.
I notice that you can do the same for "shut down", though the Finder AppleScript dictionary says it is a legacy command now delegated to other applications (I found it under System Events too). Tried it and the script doesn't bring up a confirmation dialogue before shutting down.