Amazon cli image doesn’t work with Gitlab CI

Question:

I’m trying to run the aws command (to invalidate cloudfront) using official aws image and have the following config of .gitlab-ci.yml:

The job fails with the following error:

Any ideas why it’s not working?
When I run the command locally it works.

Answer:

amazon/aws-cli docker has set entrypoint to aws as it’s expected to be executed as

but gitlab expects entry point to shell so it can then execute script commands.

Check out gitlab documentation: https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#available-settings-for-image

You will find there how to override docker image entrypoint.


Working config is:

Leave a Reply