Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Owen Rumney
committed
Sep 13, 2021
1 parent
2790bd9
commit 2a466d0
Showing
4 changed files
with
22 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
#!/bin/bash | ||
|
||
set -x | ||
|
||
function clone_image() { | ||
|
||
IMAGE=$1 | ||
OWNER=$2 | ||
|
||
if [ -z $IMAGE ]; then | ||
echo "You need to provide an image name, exiting" | ||
exit 1 | ||
fi | ||
|
||
docker tag aquasec/$IMAGE tfsec/$IMAGE | ||
echo "pushing tfsec/${IMAGE}" | ||
docker push tfsec/$IMAGE | ||
docker tag aquasec/$IMAGE aquasecurity/$IMAGE | ||
echo "pushing aquasecurity/${IMAGE}" | ||
docker push aquasecurity/$IMAGE | ||
docker tag aquasec/${IMAGE} ${OWNER}/${IMAGE} | ||
echo "pushing ${OWNER}/${IMAGE}" | ||
docker push ${OWNER}/${IMAGE} | ||
} | ||
|
||
OWNER=$1 | ||
|
||
RESULTS=$(docker image list --format {{.Repository}}:{{.Tag}} | grep aquasec/tfsec | awk -F/ '{print $2}') | ||
|
||
for RESULT in $RESULTS; do | ||
clone_image $RESULT | ||
clone_image $RESULT $OWNER | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters