diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f2b9c6b..4b97a4b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,17 +1,26 @@ -# This file is a template, and might need editing before it works on your project. -docker-build-master: - # Official docker image. +stages: + - docker builds + +build:ARM64: + stage: docker builds image: docker:latest - stage: build + variables: + DOCKER_HOST: tcp://docker:2375/ + DOCKER_DRIVER: overlay2 services: - docker:dind script: - - docker --version - - mkdir -p ~/.docker/cli-plugins - - ls -ltar ~/.docker - - ls -ltar ~/.docker/cli-plugins - - wget https://github.com/docker/buildx/releases/download/v0.3.1/buildx-v0.3.1.linux-arm64 +# Current thinking is to add build the container & tag with both the date +# in YYYY-mm-dd-h-m-s format as well as "latest": + - wget https://github.com/docker/buildx/releases/download/v0.3.1/buildx-v0.3.1.linux-amd64 - mv buildx* ~/.docker/cli-plugins/buildx - - ls -ltar ~/.docker/cli-plugins - # - export DOCKER_BUILDKIT=1 - + - chmod a+x ~/.docker/cli-plugins/docker-buildx + - docker buildx build . + # - timestamp=$(date +%Y%m%d%H%M%S) + # - cd $CI_PROJECT_DIR/ + # - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + # - docker build --no-cache . -t minio-arm64 + # - docker tag minio-arm64 registry.gitlab.com/$CI_PROJECT_PATH/minio-arm64latest + # - docker tag minio-arm64 registry.gitlab.com/$CI_PROJECT_PATH/minio-arm64:$timestamp + # - docker push registry.gitlab.com/$CI_PROJECT_PATH/minio-arm64:latest + # - docker push registry.gitlab.com/$CI_PROJECT_PATH/minio-arm64:$timestamp \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..417d312 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,39 @@ +#Pulled from: https://hub.docker.com/r/minio/minio/dockerfile + +FROM golang:1.13-alpine + +LABEL maintainer="Kelly Hair " + + +ENV GOPATH /go +ENV CGO_ENABLED 0 +ENV GO111MODULE on + +RUN \ + apk add --no-cache git && \ + git clone https://github.com/minio/minio && cd minio && \ + go install -v -ldflags "$(go run buildscripts/gen-ldflags.go)" + +FROM alpine:3.10 + +ENV MINIO_UPDATE off +ENV MINIO_ACCESS_KEY_FILE=access_key \ + MINIO_SECRET_KEY_FILE=secret_key \ + MINIO_KMS_MASTER_KEY_FILE=kms_master_key \ + MINIO_SSE_MASTER_KEY_FILE=sse_master_key + +EXPOSE 9000 + +COPY --from=0 /go/bin/minio /usr/bin/minio +COPY --from=0 /go/minio/CREDITS /third_party/ +COPY --from=0 /go/minio/dockerscripts/docker-entrypoint.sh /usr/bin/ + +RUN \ + apk add --no-cache ca-certificates 'curl>7.61.0' 'su-exec>=0.2' && \ + echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf + +ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"] + +VOLUME ["/data"] + +CMD ["minio"] \ No newline at end of file