Skip to content

Commit

Permalink
Update Docker (tenable#1242)
Browse files Browse the repository at this point in the history
* updates docker hub location

* updates docker image location

* test docker push

* docker push only from master
  • Loading branch information
Cesar Rodriguez authored May 10, 2022
1 parent 990dd2f commit beca33c
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 19 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/gobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ jobs:
- name: Build Terrascan docker image
run: make docker-build

- name: Login to docker hub
# login to docker hub only from master
- name: Login to Docker Hub
uses: docker/login-action@v2
if: ${{ github.ref == 'refs/heads/master' }}
run: echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u accurics --password-stdin
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push Terrascan latest docker image
if: ${{ github.ref == 'refs/heads/master' }}
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ jobs:
- name: Build Terrascan docker image
run: make docker-build

- name: Login to docker hub
run: echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u accurics --password-stdin
- name: Login to Docker Hub
uses: docker/login-action@v2
if: ${{ github.ref == 'refs/heads/master' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push Terrascan latest tag docker image
run: make docker-push-latest-tag
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Terrascan is a static code analyzer for Infrastructure as Code. Terrascan allows
Join our community
<br/>
<a href="https://discord.gg/ScUPMzyG3n">
<img src="http://fig.io/icons/discord-logo-square.png" width="80px" height="80px" />
<img src="http://fig.io/icons/discord-logo-square.png" width="80px" height="80px" />
</a>
</p>

Expand Down Expand Up @@ -83,7 +83,7 @@ $ brew install terrascan
Terrascan is also available as a Docker image and can be used as follows

```sh
$ docker run accurics/terrascan
$ docker run tenable/terrascan
```
Refer to [documentation](https://runterrascan.io/docs/getting-started/) for information.

Expand Down
2 changes: 1 addition & 1 deletion scripts/atlantis/docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -o nounset
set -o pipefail

GIT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null)
DOCKER_REPO="accurics/terrascan_atlantis"
DOCKER_REPO="tenable/terrascan_atlantis"
DIR="./integrations/atlantis"

docker build -t ${DOCKER_REPO}:${GIT_COMMIT} ${DIR}
2 changes: 1 addition & 1 deletion scripts/atlantis/docker-push-latest-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -o nounset
set -o pipefail

GIT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null)
DOCKER_REPO="accurics/terrascan_atlantis"
DOCKER_REPO="tenable/terrascan_atlantis"
LATEST_TAG=$(git describe --abbrev=0 --tags)
LATEST_TAG_SHORT=$(echo "${LATEST_TAG//v}")

Expand Down
2 changes: 1 addition & 1 deletion scripts/atlantis/docker-push-latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -o nounset
set -o pipefail

GIT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null)
DOCKER_REPO="accurics/terrascan_atlantis"
DOCKER_REPO="tenable/terrascan_atlantis"
LATEST_TAG="latest"

# PS: It is a prerequisite to execute 'docker login' before running this script
Expand Down
2 changes: 1 addition & 1 deletion scripts/atlantis/docker-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -o nounset
set -o pipefail

GIT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null)
DOCKER_REPO="accurics/terrascan_atlantis"
DOCKER_REPO="tenable/terrascan_atlantis"

# PS: It is a prerequisite to execute 'docker login' before running this script
docker push ${DOCKER_REPO}:${GIT_COMMIT}
4 changes: 2 additions & 2 deletions scripts/docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ set -o nounset
set -o pipefail

GIT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null)
DOCKER_REPO="accurics/terrascan"
DOCKER_REPO="tenable/terrascan"
DOCKERFILE="./build/Dockerfile"

docker buildx create --platform linux/amd64,linux/arm64 --name terrascan-builder --use

docker buildx build -t ${DOCKER_REPO}:${GIT_COMMIT} -f ${DOCKERFILE} .
docker buildx build -t ${DOCKER_REPO}:${GIT_COMMIT} -f ${DOCKERFILE} . --load

docker buildx rm terrascan-builder
3 changes: 1 addition & 2 deletions scripts/docker-push-latest-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ set -o nounset
set -o pipefail

GIT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null)
DOCKER_REPO="accurics/terrascan"
DOCKERFILE="./build/Dockerfile"
DOCKER_REPO="tenable/terrascan"
LATEST_TAG=$(git describe --abbrev=0 --tags)
LATEST_TAG_SHORT=$(echo "${LATEST_TAG//v}")

Expand Down
3 changes: 1 addition & 2 deletions scripts/docker-push-latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ set -o nounset
set -o pipefail

GIT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null)
DOCKER_REPO="accurics/terrascan"
DOCKERFILE="./build/Dockerfile"
DOCKER_REPO="tenable/terrascan"
LATEST_TAG="latest"

# PS: It is a prerequisite to execute 'docker login' before running this script
Expand Down
3 changes: 1 addition & 2 deletions scripts/docker-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ set -o nounset
set -o pipefail

GIT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null)
DOCKER_REPO="accurics/terrascan"
DOCKERFILE="./build/Dockerfile"
DOCKER_REPO="tenable/terrascan"

# PS: It is a prerequisite to execute 'docker login' before running this script
docker push ${DOCKER_REPO}:${GIT_COMMIT}

0 comments on commit beca33c

Please sign in to comment.