Posted on 11-23-2023 12:41 AM
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
Solved! Go to Solution.
11-23-2023 10:57 PM - edited 11-23-2023 10:58 PM
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!"
11-23-2023 10:57 PM - edited 11-23-2023 10:58 PM
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!"
Posted on 11-24-2023 04:38 AM
Hi Karthikeyan,
Thank you so much for the help, it worked. Thanks a lot.
Posted on 11-27-2023 05:51 AM
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.
Posted on 12-01-2023 12:15 AM
Git it, will check on it before pushing the scripts