Skip to content

Commit

Permalink
scratch update
Browse files Browse the repository at this point in the history
scratch update with static-curl
  • Loading branch information
Tob1as committed Nov 2, 2024
1 parent 3be0270 commit 1edb42a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
# context: ./
# dockerfile: alpine.multiarch.git_master.Dockerfile
#image: tobi312/minio:development
image: tobi312/minio:latest
image: tobi312/minio:latest # or: tobi312/minio:scratch
container_name: minio
#restart: unless-stopped
ports:
Expand Down Expand Up @@ -39,7 +39,7 @@ services:
#test: ["CMD", "curl", "--fail", "--insecure", "https://localhost:9000/minio/health/live"] # when use minio ssl
#start_period: 30s
interval: 60s
timeout: 10s
timeout: 5s
retries: 3
networks:
storage:
Expand Down
35 changes: 34 additions & 1 deletion scratch.multiarch.release.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,39 @@ RUN \
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

FROM alpine:latest as static-curl

# curl: https://github.com/stunnel/static-curl
# (Alternatives: https://github.com/moparisthebest/static-curl/releases or https://github.com/perryflynn/static-binaries)

ARG CURL_VERSION

RUN \
set -ex ; \
#apk add --no-cache curl ca-certificates ; \
ARCH=`uname -m` ; \
echo "ARCH=$ARCH" ; \
if [ "$ARCH" == "x86_64" ]; then \
echo "x86_64 (amd64)" ; \
TARGETARCH="$ARCH"; \
elif [ "$ARCH" == "aarch64" ]; then \
echo "aarch64 (arm64)" ; \
TARGETARCH="$ARCH"; \
elif [ "$ARCH" == "armv7l" ]; then \
echo "armv7l (arm)" ; \
TARGETARCH="armv7"; \
else \
echo "unknown arch" ; \
exit 1; \
fi ; \
export TARGETARCH=${TARGETARCH} ; \
#CURL_VERSION=${CURL_VERSION:-$(curl -s https://api.github.com/repos/stunnel/static-curl/releases/latest | grep 'tag_name' | cut -d\" -f4)} ; \
CURL_VERSION=${CURL_VERSION:-$(wget -qO- https://api.github.com/repos/stunnel/static-curl/releases/latest | grep 'tag_name' | cut -d\" -f4)} ; \
echo "CURL_VERSION=${CURL_VERSION}" ; \
#curl -sqL https://github.com/stunnel/static-curl/releases/download/${CURL_VERSION}/curl-linux-${TARGETARCH}-musl-${CURL_VERSION}.tar.xz | tar -xJ -C /usr/local/bin/ curl ; \
wget -qO- https://github.com/stunnel/static-curl/releases/download/${CURL_VERSION}/curl-linux-${TARGETARCH}-musl-${CURL_VERSION}.tar.xz | tar -xJ -C /usr/local/bin/ curl ; \
/usr/local/bin/curl --version

FROM scratch

ARG MINIO_RELEASE_VERSION
Expand Down Expand Up @@ -98,7 +131,7 @@ ENV MINIO_ACCESS_KEY_FILE=access_key \
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /usr/bin/minio /usr/bin/minio
COPY --from=build /usr/bin/mc /usr/bin/mc
#COPY --from=build /usr/bin/curl /usr/bin/curl # https://github.com/moparisthebest/static-curl/releases or https://github.com/stunnel/static-curl or https://github.com/perryflynn/static-binaries ?
COPY --from=static-curl /usr/local/bin/curl /usr/bin/curl

COPY --from=build /licenses/CREDITS /licenses/CREDITS
COPY --from=build /licenses/LICENSE /licenses/LICENSE
Expand Down

0 comments on commit 1edb42a

Please sign in to comment.