Maybe this isn't fully supported, but the icon for the user's downloads doesn't seem to work with dockutil on macOS 10.14. It's just showing as a question mark. If I right click this icon and change it to a Stack then back to Folder the icon then works.
Full script:
#!/bin/bash
echo "running dockutil"
DOCKUTIL=/usr/local/bin/dockutil
loggedInUser=$(python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "
");')
echo "remove default apps"
# remove default apps
$DOCKUTIL --remove all --no-restart --allhomes
echo "adding to dock"
# add items to dock
$DOCKUTIL --add /Applications/Google Chrome.app --position 1 --no-restart --allhomes
$DOCKUTIL --add /Applications/zoom.us.app --after "Google Chrome" --no-restart --allhomes
$DOCKUTIL --add /Applications/Slack.app --after zoom.us --no-restart --allhomes
$DOCKUTIL --add /Applications/Self Service.app --after Slack --no-restart --allhomes
$DOCKUTIL --add '/Applications/System Preferences.app' --after "Slack" --no-restart --allhomes
$DOCKUTIL --add '/Applications' --view grid --display folder --sort name --section others --position 1 --allhomes
$DOCKUTIL --add '~/Downloads' --view list --display folder --sort dateadded --section others --position end --allhomes
exit 0
