Skip to content

Commit 05e5699

Browse files
update scripts pointing to internal registry for community releases
1 parent 9e49d5e commit 05e5699

File tree

2 files changed

+66
-28
lines changed

2 files changed

+66
-28
lines changed

Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
FROM minio/minio:latest
22

3+
ARG TARGETARCH
4+
ARG RELEASE
5+
36
RUN chmod -R 777 /usr/bin
47

5-
COPY ./minio /usr/bin/minio
8+
COPY ./minio-${TARGETARCH}.${RELEASE} /usr/bin/minio
9+
COPY ./minio-${TARGETARCH}.${RELEASE}.minisig /usr/bin/minio.minisig
10+
COPY ./minio-${TARGETARCH}.${RELEASE}.sha256sum /usr/bin/minio.sha256sum
11+
612
COPY dockerscripts/docker-entrypoint.sh /usr/bin/docker-entrypoint.sh
713

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

docker-buildx.sh

Lines changed: 59 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,69 @@
11
#!/bin/bash
22

3-
sudo sysctl net.ipv6.conf.all.disable_ipv6=0
3+
set -ex
44

5-
remote=$(git remote get-url upstream)
6-
if test "$remote" != "[email protected]:minio/minio.git"; then
7-
echo "Script requires that the 'upstream' remote is set to [email protected]:minio/minio.git"
8-
exit 1
9-
fi
5+
function _init() {
6+
## All binaries are static make sure to disable CGO.
7+
export CGO_ENABLED=0
8+
export CRED_DIR="/media/${USER}/minio"
109

11-
git remote update upstream && git checkout master && git rebase upstream/master
10+
## List of architectures and OS to test coss compilation.
11+
SUPPORTED_OSARCH="linux/ppc64le linux/amd64 linux/arm64"
1212

13-
release=$(git describe --abbrev=0 --tags)
13+
remote=$(git remote get-url upstream)
14+
if test "$remote" != "[email protected]:minio/minio.git"; then
15+
echo "Script requires that the 'upstream' remote is set to [email protected]:minio/minio.git"
16+
exit 1
17+
fi
1418

15-
docker buildx build --push --no-cache \
16-
--build-arg RELEASE="${release}" \
17-
-t "minio/minio:latest" \
18-
-t "minio/minio:latest-cicd" \
19-
-t "quay.io/minio/minio:latest" \
20-
-t "quay.io/minio/minio:latest-cicd" \
21-
-t "minio/minio:${release}" \
22-
-t "quay.io/minio/minio:${release}" \
23-
--platform=linux/arm64,linux/amd64,linux/ppc64le \
24-
-f Dockerfile.release .
19+
git remote update upstream && git checkout master && git rebase upstream/master
2520

26-
docker buildx prune -f
21+
release=$(git describe --abbrev=0 --tags)
22+
export release
23+
}
2724

28-
docker buildx build --push --no-cache \
29-
--build-arg RELEASE="${release}" \
30-
-t "minio/minio:${release}-cpuv1" \
31-
-t "quay.io/minio/minio:${release}-cpuv1" \
32-
--platform=linux/arm64,linux/amd64,linux/ppc64le \
33-
-f Dockerfile.release.old_cpu .
25+
function _build() {
26+
local osarch=$1
27+
IFS=/ read -r -a arr <<<"$osarch"
28+
os="${arr[0]}"
29+
arch="${arr[1]}"
30+
package=$(go list -f '{{.ImportPath}}')
31+
printf -- "--> %15s:%s\n" "${osarch}" "${package}"
3432

35-
docker buildx prune -f
33+
# go build -trimpath to build the binary.
34+
export GOOS=$os
35+
export GOARCH=$arch
36+
export MINIO_RELEASE=RELEASE
37+
LDFLAGS=$(go run buildscripts/gen-ldflags.go)
38+
go build -tags kqueue -trimpath --ldflags "${LDFLAGS}" -o ./minio-${arch}.${release}
39+
minisign -qQSm ./minio-${arch}.${release} -s "$CRED_DIR/minisign.key" <"$CRED_DIR/minisign-passphrase"
3640

37-
sudo sysctl net.ipv6.conf.all.disable_ipv6=0
41+
sha256sum_str=$(sha256sum <./minio-${arch}.${release})
42+
rc=$?
43+
if [ "$rc" -ne 0 ]; then
44+
abort "unable to generate sha256sum for ${1}"
45+
fi
46+
echo "${sha256sum_str// -/minio.${release}}" >./minio-${arch}.${release}.sha256sum
47+
}
48+
49+
function main() {
50+
echo "Testing builds for OS/Arch: ${SUPPORTED_OSARCH}"
51+
for each_osarch in ${SUPPORTED_OSARCH}; do
52+
_build "${each_osarch}"
53+
done
54+
55+
sudo sysctl net.ipv6.conf.all.disable_ipv6=0
56+
57+
docker buildx build --push --no-cache \
58+
--build-arg RELEASE="${release}" \
59+
-t "registry.min.dev/community/minio:latest" \
60+
-t "registry.min.dev/community/minio:${release}" \
61+
--platform=linux/arm64,linux/amd64,linux/ppc64le \
62+
-f Dockerfile .
63+
64+
docker buildx prune -f
65+
66+
sudo sysctl net.ipv6.conf.all.disable_ipv6=0
67+
}
68+
69+
_init && main "$@"

0 commit comments

Comments
 (0)