Not able to run docker commands on jenkins execute shell

  1. successfully installed jenkins inside docker container.
  2. successfully created a new freestyle project jenkins job
  3. linked the job with github
  4. from the ‘execute shell’ of jenkins tried to execute certain commands.
  5. commands like ls, whoami works but none of the docker, docker-compose commands work from the shell.
  6. I keep getting the error /tmp/jenkins5519456104283077094.sh: 4: /tmp/jenkins5519456104283077094.sh: docker: not found

or when I run docker-compose I get the error docker-compose not found

I started the docker as user jenkins. when I run the same command from my terminal (logged in as jenkins) everything works fine. Only from jenkins shell I face docker/docker-compose not found error. Can anyone help me figure out the issue please?

Take a look at this.