Replies: 1 comment
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
My deployment stack looks like this:
Go project that has a Dockerfile and config.yml for GitHub automation.
Simple AWS setup where I build to ECR and deploy to my EC2 instance via Elasticbeanstalk
All my AWS credentials are stored in Github Secrets.
Previously the rest of the required env variables were stored in config.env in the Go project.
All the above automation works just fine.
For better security, easier modification with branches, etc I want to move all the information out of the config.env file into the Secrets and Variables of the GitHub Action.
Unfortunately, these are not parsing through to the env variables of the Docker container as expected. I tried for a few hours last night and have got to a point where I am stumped and its just not making sense.
So this is not the complete set of variables, but it is enough to show where I am stumped.
First Step - .elasticbeanstalk\deploy.yml for GitHub
For testing purposes I have set one env manually and one from GitHub variables (I get the same result with secrets.xxx too).
${{ secrets.AWS_REGION }} etc work as expected
Both the echo's in the run block show up in the GitHub Action logs just fine as expected. So it tells me I am pulling the Variables/Secrets just fine at this point. Both --build-arg seem to work as expected too as you will see in the next part.
Second Step - Dockerfile for building the container Once again I set one of the ARG and one of the ENV manually to test.
All three echos also show up correctly in the GitHub Action logs telling me that the ARG of DB_USER is being passed in correctly at this point.
Last Step - Inside the Docker container BUT when I check the env variables of my Docker container the manual persists, but not the one that has been passed in from the start (DB_HOST).
All of them come through fine except DB_USER. Defined right from the start and appears in all the echos but not in the last part when I check the env variable within GoAt this point, I am stumped and have yet to find anything online that helps.
Any help would be much appreciated :)
Beta Was this translation helpful? Give feedback.
All reactions