Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tob1as committed Nov 11, 2023
1 parent 5b3eca3 commit dd001f0
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 68 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/build_docker_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ jobs:
REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT}
# MinIO
RELEASE=$(curl -s https://api.github.com/repos/minio/minio/releases/latest | grep 'tag_name' | cut -d\" -f4)
echo "MINIO_RELEASE_VERSION=${RELEASE}"
MINIO_RELEASE_VERSION=${RELEASE}
MINIO_RELEASE_VERSION=$(curl -s https://api.github.com/repos/minio/minio/releases/latest | grep 'tag_name' | cut -d\" -f4)
echo "MINIO_RELEASE_VERSION=${MINIO_RELEASE_VERSION}"
# MinIO
MC_RELEASE_VERSION=$(curl -s https://api.github.com/repos/minio/mc/releases/latest | grep 'tag_name' | cut -d\" -f4)
echo "MC_RELEASE_VERSION=${MC_RELEASE_VERSION}"
# Set output parameters to GitHub action.
echo ::set-output name=build_date::${BUILD_DATE}
Expand All @@ -46,6 +49,7 @@ jobs:
echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO}
# MinIO
echo ::set-output name=minio_release_version::${MINIO_RELEASE_VERSION}
echo ::set-output name=mc_release_version::${MC_RELEASE_VERSION}
- name: Set up QEMU
id: qemu
Expand Down Expand Up @@ -92,6 +96,7 @@ jobs:
BUILD_DATE=${{steps.script.outputs.build_date}}
VCS_REF=${{steps.script.outputs.commit_hash}}
MINIO_RELEASE_VERSION=${{steps.script.outputs.minio_release_version}}
MC_RELEASE_VERSION=${{steps.script.outputs.mc_release_version}}
tags: |
ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.minio_release_version}}
ghcr.io/${{steps.script.outputs.github_repo}}:latest
Expand Down
134 changes: 69 additions & 65 deletions alpine.multiarch.release.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
FROM alpine:latest

ARG MINIO_RELEASE_VERSION
ARG RELEASE=$MINIO_RELEASE_VERSION
ARG MC_RELEASE_VERSION
ARG VCS_REF
ARG BUILD_DATE

LABEL org.opencontainers.image.title="MinIO" \
org.opencontainers.image.vendor="MinIO Inc <[email protected]>" \
org.opencontainers.image.authors="MinIO Inc <[email protected]>, Tobias Hargesheimer <[email protected]>" \
org.opencontainers.image.version="${RELEASE}" \
org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.revision="${VCS_REF}" \
org.opencontainers.image.description="MinIO is a High Performance Object Storage, API compatible with Amazon S3 cloud storage service." \
org.opencontainers.image.licenses="AGPL-3.0" \
org.opencontainers.image.url="https://hub.docker.com/r/tobi312/minio" \
org.opencontainers.image.source="https://github.com/Tob1as/docker-minio"
org.opencontainers.image.vendor="MinIO Inc <[email protected]>" \
org.opencontainers.image.authors="MinIO Inc <[email protected]>, Tobias Hargesheimer <[email protected]>" \
org.opencontainers.image.version="${MINIO_RELEASE_VERSION}" \
org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.revision="${VCS_REF}" \
org.opencontainers.image.description="MinIO is a High Performance Object Storage, API compatible with Amazon S3 cloud storage service." \
org.opencontainers.image.licenses="AGPL-3.0" \
org.opencontainers.image.url="https://hub.docker.com/r/tobi312/minio" \
org.opencontainers.image.source="https://github.com/Tob1as/docker-minio"

ENV MINIO_ACCESS_KEY_FILE=access_key \
MINIO_SECRET_KEY_FILE=secret_key \
Expand All @@ -23,63 +23,67 @@ ENV MINIO_ACCESS_KEY_FILE=access_key \
MINIO_KMS_SECRET_KEY_FILE=kms_master_key \
MINIO_UPDATE_MINISIGN_PUBKEY="RWTx5Zr1tiHQLwG9keckT0c45M3AGeHD6IvimQHpyRywVWGbP1aVSGav" \
MINIO_CONFIG_ENV_FILE=config.env \
PATH=/opt/bin:$PATH
MC_CONFIG_DIR=/tmp/.mc

RUN set -ex && \
apk add --no-cache curl ca-certificates shadow util-linux minisign && \
## GET RELEASE_VERSION ##
RELEASE=${RELEASE:-$(curl -s https://api.github.com/repos/minio/minio/releases/latest | grep 'tag_name' | cut -d\" -f4)} && \
echo "RELEASE VERSION=${RELEASE}" && \
## TARGETARCH ##
# https://en.wikipedia.org/wiki/Uname
ARCH=`uname -m` && \
echo "ARCH=$ARCH" && \
if [ "$ARCH" == "x86_64" ]; then \
echo "x86_64 (amd64)" && \
TARGETARCH="amd64"; \
elif [ "$ARCH" == "amd64" ]; then \
echo "amd64" && \
TARGETARCH="amd64"; \
elif [ "$ARCH" == "arm64" ]; then \
echo "arm64" && \
TARGETARCH="arm64"; \
elif [ "$ARCH" == "aarch64" ]; then \
echo "aarch64 (arm64)" && \
TARGETARCH="arm64"; \
elif [ "$ARCH" == "armv7l" ]; then \
echo "armv7l (arm)" && \
TARGETARCH="arm"; \
elif [ "$ARCH" == "armv6l" ]; then \
echo "armv6l (arm)" && \
TARGETARCH="arm"; \
elif [ "$ARCH" == "armhf" ]; then \
echo "armhf (arm)" && \
TARGETARCH="arm"; \
else \
echo "unknown arch" && \
exit 1; \
fi && \
export TARGETARCH=$TARGETARCH && \
## COPY FILES ##
mkdir /licenses && \
curl -s -q https://raw.githubusercontent.com/minio/minio/${RELEASE}/CREDITS -o /licenses/CREDITS && \
curl -s -q https://raw.githubusercontent.com/minio/minio/${RELEASE}/LICENSE -o /licenses/LICENSE && \
curl -s -q https://raw.githubusercontent.com/minio/minio/${RELEASE}/dockerscripts/docker-entrypoint.sh -o /usr/bin/docker-entrypoint.sh && \
curl -s -q https://raw.githubusercontent.com/minio/minio/${RELEASE}/dockerscripts/verify-minio.sh -o /usr/bin/verify-minio.sh && \
## DOWNLOAD AND INSTALL MINIO ##
mkdir -p /opt/bin && chmod -R 777 /opt/bin && \
curl -s -q https://dl.min.io/server/minio/release/linux-${TARGETARCH}/archive/minio.${RELEASE} -o /opt/bin/minio && \
curl -s -q https://dl.min.io/server/minio/release/linux-${TARGETARCH}/archive/minio.${RELEASE}.sha256sum -o /opt/bin/minio.sha256sum && \
curl -s -q https://dl.min.io/server/minio/release/linux-${TARGETARCH}/archive/minio.${RELEASE}.minisig -o /opt/bin/minio.minisig && \
chmod +x /opt/bin/minio && \
chmod +x /usr/bin/docker-entrypoint.sh && \
chmod +x /usr/bin/verify-minio.sh && \
/usr/bin/verify-minio.sh
RUN \
set -ex && \
apk add --no-cache curl ca-certificates shadow util-linux minisign && \
## TARGETARCH ##
# https://en.wikipedia.org/wiki/Uname
ARCH=`uname -m` && \
echo "ARCH=$ARCH" && \
if [ "$ARCH" == "x86_64" ]; then \
echo "x86_64 (amd64)" && \
TARGETARCH="amd64"; \
elif [ "$ARCH" == "amd64" ]; then \
echo "amd64" && \
TARGETARCH="amd64"; \
elif [ "$ARCH" == "arm64" ]; then \
echo "arm64" && \
TARGETARCH="arm64"; \
elif [ "$ARCH" == "aarch64" ]; then \
echo "aarch64 (arm64)" && \
TARGETARCH="arm64"; \
elif [ "$ARCH" == "armv7l" ]; then \
echo "armv7l (arm)" && \
TARGETARCH="arm"; \
elif [ "$ARCH" == "armv6l" ]; then \
echo "armv6l (arm)" && \
TARGETARCH="arm"; \
elif [ "$ARCH" == "armhf" ]; then \
echo "armhf (arm)" && \
TARGETARCH="arm"; \
else \
echo "unknown arch" && \
exit 1; \
fi && \
export TARGETARCH=$TARGETARCH && \
## GET MINIO_RELEASE_VERSION ##
MINIO_RELEASE_VERSION=${MINIO_RELEASE_VERSION:-$(curl -s https://api.github.com/repos/minio/minio/releases/latest | grep 'tag_name' | cut -d\" -f4)} && \
echo "MINIO_RELEASE_VERSION=${MINIO_RELEASE_VERSION}" && \
## Download minio binary and signature file ##
curl -s -q https://dl.min.io/server/minio/release/linux-${TARGETARCH}/archive/minio.${MINIO_RELEASE_VERSION} -o /usr/bin/minio && \
curl -s -q https://dl.min.io/server/minio/release/linux-${TARGETARCH}/archive/minio.${MINIO_RELEASE_VERSION}.minisig -o /tmp/minio.minisig && \
chmod +x /usr/bin/minio && \
## GET MC_RELEASE_VERSION ##
MC_RELEASE_VERSION=${MC_RELEASE_VERSION:-$(curl -s https://api.github.com/repos/minio/mc/releases/latest | grep 'tag_name' | cut -d\" -f4)} && \
echo "MC_RELEASE_VERSION=${MC_RELEASE_VERSION}" && \
## Download mc binary and signature file ##
curl -s -q https://dl.min.io/client/mc/release/linux-${TARGETARCH}/mc.${MC_RELEASE_VERSION} -o /usr/bin/mc && \
curl -s -q https://dl.min.io/client/mc/release/linux-${TARGETARCH}/mc.${MC_RELEASE_VERSION}.minisig -o /tmp/mc.minisig && \
chmod +x /usr/bin/mc && \
## Verify binary signature using public key ##
minisign -Vqm /usr/bin/minio -x /tmp/minio.minisig -P ${MINIO_UPDATE_MINISIGN_PUBKEY} && \
minisign -Vqm /usr/bin/mc -x /tmp/mc.minisig -P ${MINIO_UPDATE_MINISIGN_PUBKEY} && \
## Download minio cerdits, license and docker-entrypoint ##
mkdir /licenses && \
curl -s -q https://raw.githubusercontent.com/minio/minio/${MINIO_RELEASE_VERSION}/CREDITS -o /licenses/CREDITS && \
curl -s -q https://raw.githubusercontent.com/minio/minio/${MINIO_RELEASE_VERSION}/LICENSE -o /licenses/LICENSE && \
curl -s -q https://raw.githubusercontent.com/minio/minio/${MINIO_RELEASE_VERSION}/dockerscripts/docker-entrypoint.sh -o /usr/bin/docker-entrypoint.sh && \
chmod +x /usr/bin/docker-entrypoint.sh

EXPOSE 9000

ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]

VOLUME ["/data"]

CMD ["minio"]
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
CMD ["minio"]

0 comments on commit dd001f0

Please sign in to comment.