amazon-web-services - How can I expose the AWS_WEB_IDENTITY_TOKEN_FILE to docker container that runs on GitLab runner with Kubernetes executor
问题描述
I am running java application that tries access to AWS s3 bucket on a docker container with AWS Java SDK in order to load credentials from WebIdentityTokenCredentialsProvider.
I am running that docker on Gitlab runner with Kubernetes executor.
I created a job that runs a docker container.
myJod:
image: docker:19.03.12
script:
- all relevant installations ...
- docker-compose build
- docker-compose up
On the runner itself, I can run aws commands and get s3 buckets. Also, I have access to $AWS_WEB_IDENTITY_TOKEN_FILE from the runner.
But when I run a docker container on the runner, the docker can't access $AWS_WEB_IDENTITY_TOKEN_FILE.
I got following error:
com.amazonaws.auth.AWSCredentialsProviderChain - Unable to load credentials from WebIdentityTokenCredentialsProvider: Unable to locate specified web identity token file.
How can I solve it?
解决方案
推荐阅读
- php - 使用 DI 注入类:无法打开流
- javascript - 拼接后VUEjs Array不会更新
- apache-spark-sql - Apache Spark SQL:如何使用 GroupBy 和 Max 过滤数据
- javascript - React.js 是否以不同的方式处理“静态”?复合成分
- google-apps-script - 列的动态边框
- mysql - 从两个大表的连接中选择不同的值
- python - 将 int 转换为日期
- android - 为什么我的网站的某些 Android 浏览器中没有出现复选框?
- javascript - 以十进制存储时区
- php - 在产品标签云小部件中显示最受欢迎的 WooCommerce 产品标签