Skip to content

Commit

Permalink
Use Docker buildx for multi-platform support (#1062)
Browse files Browse the repository at this point in the history
* Use Docker buildx for multi-platform support

* test docker build

* test docker build

* Create docker buildx context

Co-authored-by: Cesar Rodriguez <cesar@accurics.com>
  • Loading branch information
rnsc and cesar-rodriguez committed Apr 7, 2022
1 parent 471df8b commit e3153a1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/gobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- name: Checkout Terrascan
uses: actions/checkout@v2

- name: Setup Go
uses: actions/setup-go@v1
with:
Expand All @@ -29,6 +29,9 @@ jobs:
- name: Install golint
run: go get -u golang.org/x/lint/golint

- name: Build Terrascan docker image
run: make docker-build

- name: Go validations
run: make validate

Expand All @@ -37,7 +40,7 @@ jobs:

- name: Run unit tests
run: make unit-tests

- name: install kind
run: make install-kind

Expand Down
6 changes: 5 additions & 1 deletion scripts/docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ GIT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null)
DOCKER_REPO="accurics/terrascan"
DOCKERFILE="./build/Dockerfile"

docker build -t ${DOCKER_REPO}:${GIT_COMMIT} -f ${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 rm terrascan-builder

0 comments on commit e3153a1

Please sign in to comment.