Is there a way to pass AWS Codebuild environment variables into a Dockerfile? I'd like to be able to pull from ECR like this:
FROM $My_AWS_ACCOUNT.dkr.ecr.us-east-1.amazonaws.com/someimage:latest
Where $My_AWS_ACCOUNT
references an environment variables within my codebuild project.
docker build --build-arg DOCKER_VAR_1=${CODEBUILD_VAR_1} --build-arg DOCKER_VAR_2=${CODEBUILD_VAR_2}
. That will pass both variable to the Dockerfile – Camilla