Jenkins not recognizing docker and aws-cli

I made a copy of my jenkins server’s homefolder and transferred it to another macOS where a fresh jenkins install was made

I have docker and AWS CLI installed, but when i run a project:

[Pipeline] sh

+ aws ecr get-login-password --region eu-central-1
/Users/admin/.jenkins/workspace/<any project name>@tmp/durable-e30d19d2/script.sh: line 1: aws: command not found

+ docker login --username AWS --password-stdin 222287*****.dkr.ecr.eu-central-1.amazonaws.com
/Users/admin/.jenkins/workspace/<any project name>@tmp/durable-e30d19d2/script.sh: line 1: docker: command not found

[Pipeline] }
[Pipeline] // withCredentials

There seems to be an issue with the path, but I’m unable to configure.
The new jenkins home folder got the permissions sorted out (chown -R).
I cant figure out whats going on.

Can you launch sh in a terminal on your new macOs machine, and see if it can find aws and docker?
Maybe your terminal uses zsh or bash with the environment variables correctly configured but they aren’t available for sh.
My $0.02.

yes the new OS does use zsh, when I

which aws

and

which docker

they are seen in the

/usr/local/bin/

Funnily enough after many hours I just found a solution:

1 Like

Thanks for the feedback about the workaround @csaba-kovacs :+1:
And by the way, welcome to the community :wave: !

1 Like