dockerjenkinsaws-cli

Running AWS Command Line Interface using Jenkins installed through Docker: command not found?


When running aws from Jenkins pipeline I have the following error message: command not found - which aws returns command not found.

By other hand, when running aws from a single job it works - which aws returns /usr/local/bin/aws.

Do you have any idea why this is happening?

Thank you.


Solution

  • You still need to install the AWS CLI inside the docker container.

    # Swap to root user to install AWS CLI then switch back to jenkins user
    USER root
    RUN apt-get update
    RUN apt-get install -y awscli
    USER jenkins