Skip to content

Commit

Permalink
Use aws-cli from base image
Browse files Browse the repository at this point in the history
  • Loading branch information
whoan committed Oct 28, 2023
1 parent a133284 commit 5a22737
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ FROM docker:24.0.7
LABEL "maintainer"="whoan <[email protected]>"
LABEL "repository"="https://github.com/whoan/docker-build-with-cache-action"

RUN apk add --no-cache bash grep jq yq aws-cli

COPY docker-build.sh /docker-build.sh
COPY entrypoint.sh /entrypoint.sh

RUN apk add --no-cache bash grep jq yq

ENTRYPOINT ["/entrypoint.sh"]
13 changes: 6 additions & 7 deletions docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,12 @@ _push_image_stages() {
docker push "$stage_image"
}

_aws() {
docker run --rm \
--env AWS_ACCESS_KEY_ID="$INPUT_USERNAME" \
--env AWS_SECRET_ACCESS_KEY="$INPUT_PASSWORD" \
--env AWS_SESSION_TOKEN="$INPUT_SESSION" \
amazon/aws-cli:2.1.14 --region "$(_get_aws_region)" "$@"
}
_aws() (
export AWS_ACCESS_KEY_ID="$INPUT_USERNAME"
export AWS_SECRET_ACCESS_KEY="$INPUT_PASSWORD"
export AWS_SESSION_TOKEN="$INPUT_SESSION"
aws --region "$(_get_aws_region)" "$@"
)

_aws_get_public_ecr_registry_name() {
_aws ecr-public describe-registries --output=text --query 'registries[0].aliases[0].name'
Expand Down

0 comments on commit 5a22737

Please sign in to comment.