How to authenticate to AWS CodeArtifact when bulding docker image asset #33923
Unanswered
francisco-parrilla-lner
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all, not sure if anyone has encounter a similar situation and find a workaround/solution.
I have a stack with a lambda function, that uses/gets created by:
That results in adding a new asset action in the Assets stage in the CI/CD pipeline. However, I'm having a hard time figuring out how to pass an environment variable that gets defined
during my build phase for the codebuild action that builds that asset.
The docs say the following about build_args "Since Docker build arguments are resolved before deployment, keys and values cannot refer to unresolved tokens (such as lambda.functionArn or queue.queueUrl)". So I assume PIP_INDEX_URL wont be passed as expected.
So for example, this is my CICD pipeline:
The reason why i specify more build commands is because I need to authenticate to Aws codeartifact repo so i can download some custom packages inside the Dockerfile. My docker file is as follows:
When the image is being built, it fails because PIP_INDEX_URL is not being passed correctly, and from the logs, i can also see that the command to build the image is
docker build --build-arg 'PIP_INDEX_URL=$PIP_INDEX_URL' --tag cdkasset-XXXXXXX --file lambda_images/catering/Dockerfile --platform linux/amd64 .
Any advice of how to solve this issue?
I tried also to authenticate to codeartifact inside the docker image (Dockerfile), but there are no aws credentials to use
Beta Was this translation helpful? Give feedback.
All reactions