Skip to content

Commit

Permalink
Merge pull request #261 from nzwei/patch-1
Browse files Browse the repository at this point in the history
look for registry in URLs not only in FROM, but also in ARG
  • Loading branch information
vito authored Mar 27, 2019
2 parents 9bb78ff + ffe8490 commit 502cbb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assets/out
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ elif [ -n "$build" ]; then
fi

ECR_REGISTRY_PATTERN='/[a-zA-Z0-9][a-zA-Z0-9_-]*\.dkr\.ecr\.[a-zA-Z0-9][a-zA-Z0-9_-]*\.amazonaws\.com(\.cn)?[^ ]*/'
ecr_images=$(grep '^\s*FROM' ${dockerfile} | \
ecr_images=$(egrep '^\s*FROM|^\s*ARG' ${dockerfile} | \
awk "match(\$0,${ECR_REGISTRY_PATTERN}){print substr(\$0, RSTART, RLENGTH)}" )
if [ -n "$ecr_images" ]; then
for ecr_image in $ecr_images
Expand Down

0 comments on commit 502cbb9

Please sign in to comment.