From e3b627a19238fafef2d672b73d8535463531a34a Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 9 Mar 2017 13:57:27 -0800 Subject: [PATCH] docker: Add ARM64 image build support (#3876) --- .travis.yml | 13 +++++-------- Dockerfile.aarch64 | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 Dockerfile.aarch64 diff --git a/.travis.yml b/.travis.yml index 18f017918..2052a4fd6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,24 +16,21 @@ env: - ARCH=i686 script: -# Refer https://blog.hypriot.com/post/setup-simple-ci-pipeline-for-arm-images/ -# prepare qemu -- docker run --rm --privileged multiarch/qemu-user-static:register --reset -# build image -- docker build -t minio/minio:edge-armhf . -f Dockerfile.armhf -# test image -- docker run --rm minio/minio:edge-armhf version - ## Run all the tests - make - make test GOFLAGS="-timeout 15m -race -v" - make coverage +# Refer https://blog.hypriot.com/post/setup-simple-ci-pipeline-for-arm-images/ # push image - > if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$ARCH" == "x86_64" ]; then + docker run --rm --privileged multiarch/qemu-user-static:register --reset + docker build -t minio/minio:edge-armhf . -f Dockerfile.armhf + docker build -t minio/minio:edge-aarch64 . -f Dockerfile.aarch64 docker login -u="$DOCKER_USER" -p="$DOCKER_PASS" docker push minio/minio:edge-armhf + docker push minio/minio:edge-aarch64 fi after_success: diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 new file mode 100644 index 000000000..e92905ecc --- /dev/null +++ b/Dockerfile.aarch64 @@ -0,0 +1,19 @@ +FROM resin/aarch64-alpine:3.5 + +ENV GOPATH /go +ENV PATH $PATH:$GOPATH/bin +ENV CGO_ENABLED 0 + +WORKDIR /go/src/github.com/minio/ + +RUN \ + apk add --no-cache ca-certificates && \ + apk add --no-cache --virtual .build-deps git go musl-dev && \ + go get -v -d github.com/minio/minio && \ + cd /go/src/github.com/minio/minio && \ + go install -v -ldflags "$(go run buildscripts/gen-ldflags.go)" && \ + rm -rf /go/pkg /go/src /usr/local/go && apk del .build-deps + +EXPOSE 9000 +ENTRYPOINT ["minio"] +VOLUME ["/export"]