Skip to content

Commit

Permalink
Add ARM64 support
Browse files Browse the repository at this point in the history
Signed-off-by: odidev <odidev@puresoftware.com>
  • Loading branch information
odidev committed Oct 26, 2021
1 parent ae0662b commit 81ac320
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ jobs:
docker login --username ${DOCKERHUB_USER} --password ${DOCKERHUB_PASSWORD} &&
export IMAGE_TAG=$([[ "$CIRCLE_BRANCH" == "staging" ]] && echo "staging-candidate" || echo "discardable") &&
IMAGE_NAME_CANDIDATE=snyk/kubernetes-monitor:${IMAGE_TAG}-${CIRCLE_SHA1} &&
./scripts/docker/build-image.sh ${IMAGE_NAME_CANDIDATE} &&
docker push ${IMAGE_NAME_CANDIDATE}
./scripts/docker/build-image.sh ${IMAGE_NAME_CANDIDATE}
name: Build image
- run:
command: |
Expand Down
3 changes: 1 addition & 2 deletions .circleci/config/jobs/@jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ build_image:
docker login --username ${DOCKERHUB_USER} --password ${DOCKERHUB_PASSWORD} &&
export IMAGE_TAG=$([[ "$CIRCLE_BRANCH" == "staging" ]] && echo "staging-candidate" || echo "discardable") &&
IMAGE_NAME_CANDIDATE=snyk/kubernetes-monitor:${IMAGE_TAG}-${CIRCLE_SHA1} &&
./scripts/docker/build-image.sh ${IMAGE_NAME_CANDIDATE} &&
docker push ${IMAGE_NAME_CANDIDATE}
./scripts/docker/build-image.sh ${IMAGE_NAME_CANDIDATE}
- run:
name: Notify Slack on failure
command: |
Expand Down
7 changes: 6 additions & 1 deletion scripts/docker/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@ LOCAL_DISCARDABLE_IMAGE=snyk/kubernetes-monitor:local
# should happen on merging to `staging`
NAME_AND_TAG=${1:-$LOCAL_DISCARDABLE_IMAGE}

docker build -t ${NAME_AND_TAG} .
mkdir -vp ~/.docker/cli-plugins/
curl --silent -L --output ~/.docker/cli-plugins/docker-buildx https://github.com/docker/buildx/releases/download/v0.6.3/buildx-v0.6.3.linux-amd64
chmod a+x ~/.docker/cli-plugins/docker-buildx
docker run -it --rm --privileged tonistiigi/binfmt --install all
docker buildx create --use --name mybuilder
docker buildx build --platform linux/amd64,linux/arm64 -t ${NAME_AND_TAG} --push .

0 comments on commit 81ac320

Please sign in to comment.