I don’t think that is going to work since /usr/local/bin/docker is just a symlink to Library/Group Containers/group.com.docker/bin/docker. Permissions ~/Library are locked to the user and you’d have to open them to other users/groups (not recommended) in order to achieve what you are looking to do. Perhaps a VM with Jenkins and Docker on a Linux guest would be a better solution (unless you have a need to run Jenkins on Mac, perhaps for using xcode tools to build iOS/macOS apps)…
Actually I just realized /usr/local/bin/docker is a symlink to a symlink which ultimately resolves to /Applications/Docker.app/Contents/Resources/bin/docker.
You may want to try using the full path in your Jenkins test: /Applications/Docker.app/Contents/Resources/bin/docker images
The path of /Applications/Docker.app/Contents/Resources/bin/docker can be executed, but it tells me that Cannot connect to the Docker daemon. Is the docker daemon running on this host? But the docker for mac is running.
It must have to do with how the docker command is set to communicate with the almost-transparent xhyve VM. I’m stumped. However, regarding my original suggestion, does your use case require Jenkins to build anything iOS/macOS specific?