Skip to content

Commit

Permalink
Merge pull request #5 from probr/feature/eks
Browse files Browse the repository at this point in the history
Corrected AWS credential handling to happen in entrypoint
  • Loading branch information
Eddie Knight authored Feb 3, 2022
2 parents 6a1ca8c + c748ceb commit 44484c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@ COPY . .
ARG VERSION_PROBR=v0.1.2
ARG VERSION_K8S=v0.1.1
ARG VERSION_AKS=v0.1.0
ARG AWS_ACCESS_KEY_ID=
ARG AWS_SECRET_ACCESS_KEY=

RUN mkdir ~/.aws && \
echo "[default]" >> ~/.aws/credentials && \
echo "aws_access_key_id=${AWS_ACCESS_KEY_ID}" >> ~/.aws/credentials && \
echo "aws_secret_access_key=${AWS_SECRET_ACCESS_KEY}" >> ~/.aws/credentials
# Env vars may be passed in at runtime
ENV AWS_ACCESS_KEY_ID=
ENV AWS_SECRET_ACCESS_KEY=

RUN make probr VERSION=${VERSION_PROBR} && \
mv /probr/cmd/bin/probr /probr/cmd/probr
Expand All @@ -42,4 +39,4 @@ ENV PROBR_WRITE_DIRECTORY /probr/run
# Service packs may be overridden for debugging by mounting to /probr/cmd/bin
# Entrypoint may be overridden by mounting to /probr/entrypoint.sh
WORKDIR /probr/run
ENTRYPOINT ["/probr/cmd/probr"]
ENTRYPOINT ["entrypoint.sh"]
8 changes: 8 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# If using AWS, credentials are required
# If not using AWS, this has no effect
mkdir ~/.aws
echo "[default]" >> ~/.aws/credentials
echo "aws_access_key_id=${AWS_ACCESS_KEY_ID}" >> ~/.aws/credentials
echo "aws_secret_access_key=${AWS_SECRET_ACCESS_KEY}" >> ~/.aws/credentials

/probr/cmd/probr

0 comments on commit 44484c7

Please sign in to comment.