Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QUA-498: support arm64/v8 architecture for Mac M1 chips #1041

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
9 changes: 8 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@ jobs:
build_test:
environment:
CC_TEST_REPORTER_ID: e70e48da820d9d23eeb2f1fd8c25f8691be05af308dd0ffce8d1ca7e48a5f799
machine: true
machine:
image: ubuntu-2004:202111-02
steps:
- run: docker system info
- run: docker buildx ls
- run:
name: Install buildx emulators
command: docker run -it --rm --privileged tonistiigi/binfmt --install all
- run: docker buildx ls
- checkout
- run:
name: Install test reporter
Expand Down
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM alpine:3.11.6

ARG TARGETARCH

WORKDIR /usr/src/app
COPY Gemfile /usr/src/app/
COPY Gemfile.lock /usr/src/app/
Expand All @@ -23,8 +25,11 @@ RUN apk --no-cache upgrade && \
apk del build-base && \
rm -fr /usr/share/ri

RUN wget -q -O /tmp/docker.tgz \
https://download.docker.com/linux/static/stable/x86_64/docker-17.12.1-ce.tgz && \
RUN ARCH="$TARGETARCH"; \
if [ "$ARCH" = "arm64" ]; then ARCH=aarch64; \
elif [ "$ARCH" = "amd64" ]; then ARCH=x86_64; fi; \
wget -q -O /tmp/docker.tgz \
https://download.docker.com/linux/static/stable/$ARCH/docker-17.12.1-ce.tgz && \
tar -C /tmp -xzvf /tmp/docker.tgz && \
mv /tmp/docker/docker /bin/docker && \
chmod +x /bin/docker && \
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

PREFIX ?= /usr/local
SKIP_ENGINES ?= 0
BUILDX_PLATFORMS ?= linux/amd64,linux/arm64

image:
docker pull "$(shell grep FROM Dockerfile | sed 's/FROM //')"
docker build -t codeclimate/codeclimate .
docker buildx create --name multi_arch_builder --use
docker buildx build --platform=linux/amd64,linux/arm64 -t codeclimate/codeclimate .

test: RSPEC_ARGS ?= --tag ~slow
test: image
Expand Down