Skip to content

Commit

Permalink
Add hack to copy over images to docker hub (aquasecurity#856)
Browse files Browse the repository at this point in the history
* Add hack to copy over images to docer hub

* Add the script to do the retag
  • Loading branch information
owenrumney authored Jul 12, 2021
1 parent 6793823 commit ea39446
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,13 @@ jobs:
run: make publish-docs
env:
DOCS_GITHUB_TOKEN: ${{ secrets.DOCS_GITHUB_TOKEN }}


# temporary hack to copy over the aquasec images to legacy docker hub repo
- name: Login to docker.io registry
uses: docker/login-action@v1
with:
username: ${{ secrets.TFSEC_DOCKERHUB_USER }}
password: ${{ secrets.TFSEC_DOCKERHUB_TOKEN }}

- name: Tfsec image building
run: make clone-images
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,7 @@ quality: cyclo vet typos
.PHONY: fix-typos
fix-typos:
./scripts/typos.sh fix

.PHONY: clone-image
clone-image:
./scripts/clone-images.sh
21 changes: 21 additions & 0 deletions scripts/clone-images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

function clone_image() {

IMAGE=$1

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
}

RESULTS=$(docker image list --format {{.Repository}}:{{.Tag}} | grep aquasec/tfsec | awk -F/ '{print $2}')

for RESULT in $RESULTS; do
clone_image $RESULT
done

0 comments on commit ea39446

Please sign in to comment.