docker: Add ARM64 image build support (#3876)

This commit is contained in:
Harshavardhana 2017-03-09 13:57:27 -08:00 committed by GitHub
parent ccc3349f0c
commit e3b627a192
2 changed files with 24 additions and 8 deletions

View File

@ -16,24 +16,21 @@ env:
- ARCH=i686 - ARCH=i686
script: 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 ## Run all the tests
- make - make
- make test GOFLAGS="-timeout 15m -race -v" - make test GOFLAGS="-timeout 15m -race -v"
- make coverage - make coverage
# Refer https://blog.hypriot.com/post/setup-simple-ci-pipeline-for-arm-images/
# push image # push image
- > - >
if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$ARCH" == "x86_64" ]; then 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 login -u="$DOCKER_USER" -p="$DOCKER_PASS"
docker push minio/minio:edge-armhf docker push minio/minio:edge-armhf
docker push minio/minio:edge-aarch64
fi fi
after_success: after_success:

19
Dockerfile.aarch64 Normal file
View File

@ -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"]