mirror of
https://git.netzspielplatz.de/docker-multiarch/minio.git
synced 2025-11-08 23:39:33 +00:00
Compare commits
No commits in common. "main" and "v0.9" have entirely different histories.
3 changed files with 94 additions and 40 deletions
106
.gitlab-ci.yml
106
.gitlab-ci.yml
|
|
@ -1,31 +1,87 @@
|
||||||
image: egon0/docker-with-buildx-and-git:latest
|
# Credit -> https://stackoverflow.com/questions/58600986/gitlab-ci-trying-to-use-docker-buildx-to-build-for-arm64
|
||||||
|
|
||||||
variables:
|
stages:
|
||||||
DOCKER_HOST: tcp://docker:2375/
|
- buildx
|
||||||
DOCKER_DRIVER: overlay2
|
- deploy
|
||||||
DOCKER_TLS_CERTDIR: ""
|
- Weekly buildx
|
||||||
|
- Weekly deploy
|
||||||
|
|
||||||
services:
|
# ----- Ad hoc Builds -----
|
||||||
- docker:dind
|
|
||||||
|
|
||||||
build:
|
buildx:
|
||||||
stage: build
|
image: docker:19.03-git
|
||||||
|
stage: buildx
|
||||||
variables:
|
variables:
|
||||||
IMAGE_TAG: $CI_REGISTRY_IMAGE
|
GIT_STRATEGY: none
|
||||||
D_IMAGE_TAG: egon0/minio-multiarch
|
artifacts:
|
||||||
D_LATEST_TAG: egon0/minio-multiarch:latest
|
paths:
|
||||||
|
- buildx
|
||||||
|
expire_in: 3 hour
|
||||||
|
services:
|
||||||
|
- docker:19.03-dind
|
||||||
script:
|
script:
|
||||||
- >
|
- export DOCKER_BUILDKIT=1
|
||||||
apk add --no-cache jq;
|
- git clone git://github.com/docker/buildx ./docker-buildx
|
||||||
LATEST_MINIO_GITHUB=$(wget --quiet "https://api.github.com/repos/minio/minio/releases/latest" -O - | jq -r '.tag_name');
|
- docker build --platform=local -o . ./docker-buildx
|
||||||
LATEST_MINIO_DHUB=$(wget -q https://registry.hub.docker.com/v1/repositories/egon0/minio-multiarch/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}' | tail -n1);
|
only:
|
||||||
if [ "$LATEST_MINIO_GITHUB" != "$LATEST_MINIO_DHUB" ]
|
changes:
|
||||||
then
|
- Dockerfile
|
||||||
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
- .gitlab-ci.yml
|
||||||
docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
|
|
||||||
docker buildx create --use --name A$CI_COMMIT_SHORT_SHA
|
|
||||||
docker buildx build --platform $BUILD_PLATFORMS --push -t $IMAGE_TAG:$LATEST_MINIO_GITHUB -t $CI_REGISTRY_IMAGE:latest -t $D_IMAGE_TAG:$LATEST_MINIO_GITHUB -t $D_LATEST_TAG .
|
|
||||||
else
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
image: docker:19.03
|
||||||
|
stage: deploy
|
||||||
|
services:
|
||||||
|
- name: docker:19.03-dind
|
||||||
|
command: ["--experimental"]
|
||||||
|
before_script:
|
||||||
|
- mkdir -p ~/.docker/cli-plugins
|
||||||
|
- mv buildx ~/.docker/cli-plugins/docker-buildx
|
||||||
|
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||||
|
script:
|
||||||
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
||||||
|
- docker buildx create --use --name mybuilder
|
||||||
|
- docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --push -t $CI_REGISTRY_IMAGE .
|
||||||
|
only:
|
||||||
|
changes:
|
||||||
|
- Dockerfile
|
||||||
|
- .gitlab-ci.yml
|
||||||
|
|
||||||
|
# ----- Weekly Build -----
|
||||||
|
|
||||||
|
weekly:buildx:
|
||||||
|
image: docker:19.03-git
|
||||||
|
stage: Weekly buildx
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- buildx
|
||||||
|
expire_in: 3 hour
|
||||||
|
services:
|
||||||
|
- docker:19.03-dind
|
||||||
|
script:
|
||||||
|
- export DOCKER_BUILDKIT=1
|
||||||
|
- git clone git://github.com/docker/buildx ./docker-buildx
|
||||||
|
- docker build --platform=local -o . ./docker-buildx
|
||||||
|
only:
|
||||||
|
- schedules
|
||||||
|
- master
|
||||||
|
|
||||||
|
weekly:deploy:
|
||||||
|
image: docker:19.03
|
||||||
|
stage: Weekly deploy
|
||||||
|
services:
|
||||||
|
- name: docker:19.03-dind
|
||||||
|
command: ["--experimental"]
|
||||||
|
before_script:
|
||||||
|
- mkdir -p ~/.docker/cli-plugins
|
||||||
|
- mv buildx ~/.docker/cli-plugins/docker-buildx
|
||||||
|
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||||
|
script:
|
||||||
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
||||||
|
- docker buildx create --use --name mybuilder
|
||||||
|
- docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --push -t $CI_REGISTRY_IMAGE .
|
||||||
|
only:
|
||||||
|
- schedules
|
||||||
|
- master
|
||||||
25
Dockerfile
25
Dockerfile
|
|
@ -1,19 +1,20 @@
|
||||||
FROM golang:1.18-alpine as builder
|
#Pulled from: https://hub.docker.com/r/minio/minio/dockerfile
|
||||||
|
|
||||||
|
FROM golang:1.13-alpine
|
||||||
|
|
||||||
|
LABEL maintainer="Kelly Hair <khair@gitlab.com>"
|
||||||
|
|
||||||
LABEL maintainer="MinIO Inc <dev@min.io>"
|
|
||||||
|
|
||||||
ENV GOPATH /go
|
ENV GOPATH /go
|
||||||
ENV CGO_ENABLED 0
|
ENV CGO_ENABLED 0
|
||||||
ENV GO111MODULE on
|
ENV GO111MODULE on
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
apk add --no-cache git jq && \
|
apk add --no-cache git && \
|
||||||
git config --global advice.detachedHead false && \
|
git clone https://github.com/minio/minio && cd minio && \
|
||||||
LATEST_MINIO_GITHUB=$(wget --quiet "https://api.github.com/repos/minio/minio/releases/latest" -O - | jq -r '.tag_name'); \
|
go install -v -ldflags "$(go run buildscripts/gen-ldflags.go)"
|
||||||
git clone https://github.com/minio/minio && cd minio && \
|
|
||||||
git checkout "$LATEST_MINIO_GITHUB" && go install -v -ldflags "$(go run buildscripts/gen-ldflags.go)"
|
|
||||||
|
|
||||||
FROM alpine:3.16
|
FROM alpine:3.10
|
||||||
|
|
||||||
ENV MINIO_UPDATE off
|
ENV MINIO_UPDATE off
|
||||||
ENV MINIO_ACCESS_KEY_FILE=access_key \
|
ENV MINIO_ACCESS_KEY_FILE=access_key \
|
||||||
|
|
@ -23,9 +24,9 @@ ENV MINIO_ACCESS_KEY_FILE=access_key \
|
||||||
|
|
||||||
EXPOSE 9000
|
EXPOSE 9000
|
||||||
|
|
||||||
COPY --from=builder /go/bin/minio /usr/bin/minio
|
COPY --from=0 /go/bin/minio /usr/bin/minio
|
||||||
COPY --from=builder /go/minio/CREDITS /third_party/
|
COPY --from=0 /go/minio/CREDITS /third_party/
|
||||||
COPY --from=builder /go/minio/dockerscripts/docker-entrypoint.sh /usr/bin/
|
COPY --from=0 /go/minio/dockerscripts/docker-entrypoint.sh /usr/bin/
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
apk add --no-cache ca-certificates 'curl>7.61.0' 'su-exec>=0.2' && \
|
apk add --no-cache ca-certificates 'curl>7.61.0' 'su-exec>=0.2' && \
|
||||||
|
|
@ -35,4 +36,4 @@ ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
|
||||||
|
|
||||||
VOLUME ["/data"]
|
VOLUME ["/data"]
|
||||||
|
|
||||||
CMD ["minio"]
|
CMD ["minio"]
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue