mirror of
https://github.com/pgsty/minio.git
synced 2026-08-09 07:43:29 +03:00
30749911bd
Dockerfile.goreleaser now copies silo to /usr/bin/silo, defaults to CMD ["silo"], and labels the image as Silo. MINIO_UPDATE_MINISIGN_PUBKEY is removed from the image environment: with the updater permanently disabled it was dead weight, and leaving upstream's verification key in a Silo image implied a trust relationship that does not exist. The MINIO_* runtime environment variables, ports, volume and health endpoints are unchanged. The image keeps shipping mcli with an /usr/bin/mc symlink. That is the client, not a MinIO-branded alias for the server binary, and the Helm post-install job and existing container scripts call it by name. docker-entrypoint.sh translates a legacy first argument: `minio server /data` becomes `silo server /data`, so an existing `command: minio server ...` in compose or a Pod spec keeps working across the image swap. The translation is argv-level only - no file named minio is installed, and an explicitly overridden `entrypoint: /usr/bin/minio` still fails, which is the honest outcome since that path genuinely no longer exists. The entrypoint also fixes an unrelated startup hazard it was already carrying: when the image runs under an arbitrary UID, HOME points at an unreadable /root and the server probes its default config directory during initialization. It now falls back to /tmp when HOME is unset, /root, missing or unwritable. docker-entrypoint_test.sh pins all of it - empty argv, legacy minio, native silo, bare flags, and an explicit shell command that must stay explicit. It is wired into make rebrand-guard and into the go.yml, release.yml and test-release.yml gates, so removing the shim breaks CI rather than breaking users. Passing locally. download-static-curl.sh gains checksum verification for the curl it fetches into the build stage. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
76 lines
2.7 KiB
Bash
Executable File
76 lines
2.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
work_dir="$(mktemp -d)"
|
|
trap 'rm -rf "${work_dir}"' EXIT
|
|
|
|
mkdir -p "${work_dir}/bin"
|
|
cat >"${work_dir}/bin/silo" <<'EOF'
|
|
#!/bin/sh
|
|
printf '%s\n' silo "$@" >"${ENTRYPOINT_CAPTURE}"
|
|
if [ -n "${ENTRYPOINT_HOME_CAPTURE:-}" ]; then
|
|
printf '%s\n' "${HOME:-}" >"${ENTRYPOINT_HOME_CAPTURE}"
|
|
fi
|
|
EOF
|
|
chmod +x "${work_dir}/bin/silo"
|
|
|
|
cat >"${work_dir}/bin/chroot" <<'EOF'
|
|
#!/bin/sh
|
|
printf '%s\n' "$1" "$2" >"${ENTRYPOINT_CHROOT_CAPTURE}"
|
|
shift 2
|
|
exec "$@"
|
|
EOF
|
|
chmod +x "${work_dir}/bin/chroot"
|
|
|
|
run_case() {
|
|
local name="$1"
|
|
local expected="$2"
|
|
shift 2
|
|
local capture="${work_dir}/${name}.actual"
|
|
local expected_file="${work_dir}/${name}.expected"
|
|
|
|
ENTRYPOINT_CAPTURE="${capture}" PATH="${work_dir}/bin:${PATH}" \
|
|
"${script_dir}/docker-entrypoint.sh" "$@"
|
|
printf '%s' "${expected}" >"${expected_file}"
|
|
diff -u "${expected_file}" "${capture}"
|
|
}
|
|
|
|
run_case default $'silo\n'
|
|
run_case server $'silo\nserver\n/data\n' server /data
|
|
run_case option $'silo\n--version\n' --version
|
|
run_case explicit-silo $'silo\nserver\n/data\n' silo server /data
|
|
run_case legacy-minio $'silo\nserver\n/data\n' minio server /data
|
|
|
|
shell_capture="${work_dir}/shell.actual"
|
|
# shellcheck disable=SC2016 # ENTRYPOINT_CAPTURE is expanded by the child shell.
|
|
ENTRYPOINT_CAPTURE="${shell_capture}" PATH="${work_dir}/bin:${PATH}" \
|
|
"${script_dir}/docker-entrypoint.sh" sh -c 'printf "%s\n" shell >"${ENTRYPOINT_CAPTURE}"'
|
|
test "$(cat "${shell_capture}")" = shell
|
|
|
|
rootless_capture="${work_dir}/rootless.actual"
|
|
rootless_home_capture="${work_dir}/rootless-home.actual"
|
|
rootless_chroot_capture="${work_dir}/rootless-chroot.actual"
|
|
ENTRYPOINT_CAPTURE="${rootless_capture}" \
|
|
ENTRYPOINT_HOME_CAPTURE="${rootless_home_capture}" \
|
|
ENTRYPOINT_CHROOT_CAPTURE="${rootless_chroot_capture}" \
|
|
HOME=/root MINIO_USERNAME=silo-user MINIO_GROUPNAME=silo-group \
|
|
MINIO_UID=1001 MINIO_GID=1002 PATH="${work_dir}/bin:${PATH}" \
|
|
"${script_dir}/docker-entrypoint.sh" silo --version
|
|
test "$(cat "${rootless_home_capture}")" = /tmp
|
|
test "$(sed -n '1p' "${rootless_chroot_capture}")" = --userspec=1001:1002
|
|
test "$(sed -n '2p' "${rootless_chroot_capture}")" = /
|
|
test "$(cat "${rootless_capture}")" = $'silo\n--version'
|
|
|
|
arbitrary_uid_capture="${work_dir}/arbitrary-uid.actual"
|
|
arbitrary_uid_home_capture="${work_dir}/arbitrary-uid-home.actual"
|
|
ENTRYPOINT_CAPTURE="${arbitrary_uid_capture}" \
|
|
ENTRYPOINT_HOME_CAPTURE="${arbitrary_uid_home_capture}" \
|
|
HOME="${work_dir}/missing-home" PATH="${work_dir}/bin:${PATH}" \
|
|
"${script_dir}/docker-entrypoint.sh" silo --version
|
|
test "$(cat "${arbitrary_uid_home_capture}")" = /tmp
|
|
test "$(cat "${arbitrary_uid_capture}")" = $'silo\n--version'
|
|
|
|
echo "docker entrypoint argv compatibility tests passed"
|