Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

349
Views
Inject AWS Codebuild Environment Variables into Dockerfile

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.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Yes, you can use FROM ${My_AWS_ACCOUNT}.xxx. My_AWS_ACCOUNT should be passed as an argument to the docker build. This is how I would do it:

ARG My_AWS_ACCOUNT=SOME_DEFAULT_IMAGE FROM ${My_AWS_ACCOUNT}.xxx

When you build: docker build --build-arg My_AWS_ACCOUNT=${My_AWS_ACCOUNT}

over 4 years ago · Santiago Trujillo Report

0

Yet another amazingly annoying thing in Docker that doesn't actually need to be this difficult but for some reason is supremely complicated and/or non-intuitive.

command line:

docker build --build-arg My_AWS_ACCOUNT=${My_AWS_ACCOUNT}

Dockerfile:

ARG My_AWS_ACCOUNT
FROM ${My_AWS_ACCOUNT}.dkr.ecr.us-east-1.amazonaws.com/someimage:latest
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!