Hi All,
We are working on removing Docker desktop from Macs, tried few scripts for uninstalling through Jamf Pro however we are getting an error stating root access is needed. Wanted to check if anybody knows of a way to remove docker through jamf.
The script user
Hi @RahulR Jamf Pro runs the scripts as root so you do not need the first part of the script. You also waiting for user input in while loop which will not work with Jamf. Check with the below script. I removed both the parts from your scripts.
Thanks.
#!/bin/bash
# Uninstall Script
while true; do
docker-machine rm -f $(docker-machine ls -q); break;
done
echo "Removing Applications..."
rm -rf /Applications/Docker.app
echo "Removing docker binaries..."
rm -f /usr/local/bin/docker
rm -f /usr/local/bin/docker-machine
rm -r /usr/local/bin/docker-machine-driver*
rm -f /usr/local/bin/docker-compose
echo "Removing boot2docker.iso"
rm -rf /usr/local/share/boot2docker
echo "Forget packages"
pkgutil --forget io.docker.pkg.docker
pkgutil --forget io.docker.pkg.dockercompose
pkgutil --forget io.docker.pkg.dockermachine
pkgutil --forget io.boot2dockeriso.pkg.boot2dockeriso
echo "All Done!"
Hi @RahulR Jamf Pro runs the scripts as root so you do not need the first part of the script. You also waiting for user input in while loop which will not work with Jamf. Check with the below script. I removed both the parts from your scripts.
Thanks.
#!/bin/bash
# Uninstall Script
while true; do
docker-machine rm -f $(docker-machine ls -q); break;
done
echo "Removing Applications..."
rm -rf /Applications/Docker.app
echo "Removing docker binaries..."
rm -f /usr/local/bin/docker
rm -f /usr/local/bin/docker-machine
rm -r /usr/local/bin/docker-machine-driver*
rm -f /usr/local/bin/docker-compose
echo "Removing boot2docker.iso"
rm -rf /usr/local/share/boot2docker
echo "Forget packages"
pkgutil --forget io.docker.pkg.docker
pkgutil --forget io.docker.pkg.dockercompose
pkgutil --forget io.docker.pkg.dockermachine
pkgutil --forget io.boot2dockeriso.pkg.boot2dockeriso
echo "All Done!"
Hi Karthikeyan,
Thank you so much for the help, it worked. Thanks a lot.
Just want to point out something that tripped me up when I had to remove docker from my fleet. Make sure to run an update inventory on devices so that Jamf knows the app has been deleted. Also if devices continue to appear as though they have docker installed but user says they deleted, verify it's not sitting in the recycle bin and that there are no rogue launchAgents or lauchDaemons or Preference files lingering.
Git it, will check on it before pushing the scripts
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.