I need to extend the aws cli docker image with some custom scripts
I have created a docker file and am copying the script files into a directory
when using the docker file in my gitlab job I get the following error:
Dockerfile:

FROM amazon/aws-cli:latest
ADD scripts /usr/local/bin/aws-scripts/
RUN chmod -R 755 /usr/local/bin/aws-scripts
CMD [ "/usr/local/bin/aws-scripts/aws-version.sh" ]
Pipeline error:
Using docker image sha256:00fa868560bb812a79ed5d3895ab3aaa6a3f4a7f0b376415a7538f5bea8db4e9 for registry.gitlab.com/yumbrands/phdt/lambda-canary-scripts with digest registry.gitlab.com/yumbrands/phdt/lambda-canary-scripts@sha256:270e337dc3f149e52ec5d4c70537409f98973d80fa3ef8c567de4ba70ea0694d ...
usage: aws [options] [ ...] [parameters]
To see help text, you can run:
aws help
aws help
aws help
aws: error: argument command: Invalid choice, valid choices are:
accessanalyzer | account
acm | acm-pca
aiops | amp
I have tried to change the content of the aws-version
file to the following but both instances fail:
aws --version
And:
aws --help
Asked by xerxes
(359 rep)
Jul 3, 2025, 02:56 PM
Last activity: Jul 3, 2025, 03:57 PM
Last activity: Jul 3, 2025, 03:57 PM