-
Notifications
You must be signed in to change notification settings - Fork 978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI not provided for Local CodeBuild #179
Comments
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI is only available within the context of CodeBuild on AWS cloud. How are you using environment variable within your builds? How does it effect your local builds? A buildspec sample would be great. |
Our primary use case pretty much exactly what is outlined in the Troubleshooting CodeBuild Error: "Unable to Locate Credentials" link I posted prior. We pass the IAM role of the build to our docker image being built or run. The docker image maybe creating an artifact or be the artifact itself. For example the role is used for to resolve python pip requirements.txt entries like Another way the role is used is via s3-wagon-private which allows maven dependencies to live on s3 buckets and the dependency tool resolves permissions via the IAM role. Currently Local CodeBuild lets me use the A typical buildspec is:
or
Ideally if I pass |
Typically we work around this problem in a "local build" because we just run the docker build locally and mount in our .aws directory via |
Y'all should grab something from the recent ECS local service: https://aws.amazon.com/blogs/compute/a-guide-to-locally-testing-containers-with-amazon-ecs-local-endpoints-and-docker-compose/ |
Hi I was able to get everything working by running the ECS Local Container Endpoints and updating my iptables to route requests to it per https://github.com/awslabs/amazon-ecs-local-container-endpoints#option-2-set-up-iptables-rules I also had to provide an environment variable file:
And then I could run:
And even my docker containers got IAM credentials. Local CodeBuild nirvana! |
PS on macOS you can do
and then
and that should make it work on docker desktop for macos. to remove the alias do
|
For those that have come here and here and are having trouble with SSO-based credentials, check out this issue for a fix: |
We have several builds that pass the
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
environment variable per Troubleshooting CodeBuild Error: "Unable to Locate Credentials"So when we try the following AWS_CONTAINER_CREDENTIALS_RELATIVE_URI isn't in the environment so I cannot test these builds locally.
Can you all update the local build to provide this service?
The text was updated successfully, but these errors were encountered: