change base-image
This commit is contained in:
@@ -1,12 +1,22 @@
|
||||
FROM minio/minio:latest
|
||||
FROM ghcr.io/home-assistant/amd64-addon-base:latest
|
||||
|
||||
LABEL \
|
||||
io.hass.version="1.0.5" \
|
||||
io.hass.type="addon" \
|
||||
io.hass.arch="aarch64|amd64" \
|
||||
io.hass.name="MinIO" \
|
||||
io.hass.description="MinIO is an object storage server compatible with Amazon S3."
|
||||
LABEL io.hass.name="MinIO"
|
||||
LABEL io.hass.description="S3-compatible object storage for HA"
|
||||
LABEL io.hass.arch="amd64|aarch64"
|
||||
LABEL io.hass.type="addon"
|
||||
LABEL io.hass.version="1.0.6"
|
||||
|
||||
# Install curl and download MinIO binary
|
||||
# https://min.io/download#/linux
|
||||
# https://docs.min.io/docs/minio-server-quickstart-guide.html
|
||||
RUN apk add --no-cache curl \
|
||||
&& curl -fsSL https://dl.min.io/server/minio/release/linux-amd64/minio \
|
||||
-o /usr/local/bin/minio \
|
||||
&& chmod +x /usr/local/bin/minio \
|
||||
&& apk del curl
|
||||
|
||||
# Copy the script into the container
|
||||
# make it executable and run it
|
||||
COPY run.sh /run.sh
|
||||
RUN chmod +x /run.sh
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "MinIO S3 Server",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"slug": "minio",
|
||||
"description": "MinIO Server S3-compatible object storage server",
|
||||
"arch": [
|
||||
|
||||
38
minio/run.sh
38
minio/run.sh
@@ -1,25 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
echo "[DEBUG] Run script started"
|
||||
bashio::log.info "Run script started"
|
||||
|
||||
# Config via HA options
|
||||
export MINIO_ROOT_USER="${access_key}"
|
||||
export MINIO_ROOT_PASSWORD="${secret_key}"
|
||||
export MINIO_REGION="${region:-us-east-1}"
|
||||
ACCESS_KEY=$(bashio::config 'access_key')
|
||||
SECRET_KEY=$(bashio::config 'secret_key')
|
||||
REGION=$(bashio::config 'region')
|
||||
BUCKET=$(bashio::config 'bucket')
|
||||
|
||||
# Config via env vars (for docker container)
|
||||
export MINIO_ROOT_USER="${ACCESS_KEY}"
|
||||
export MINIO_ROOT_PASSWORD="${SECRET_KEY}"
|
||||
export MINIO_REGION="${REGION:-us-east-1}"
|
||||
|
||||
|
||||
# TLS support (optional, autodetect)
|
||||
CERT_PATH="/ssl/cert.pem"
|
||||
KEY_PATH="/ssl/key.pem"
|
||||
|
||||
# First-run: make sure bucket exists (done via client)
|
||||
DATA_DIR="/data/${bucket}"
|
||||
mkdir -p "$DATA_DIR"
|
||||
DATA_DIR="/data/${BUCKET}"
|
||||
mkdir -p "${DATA_DIR}"
|
||||
|
||||
echo "[INFO] Starting MinIO (user: $MINIO_ROOT_USER, region: $MINIO_REGION)"
|
||||
if [[ -f "$CERT_PATH" && -f "$KEY_PATH" ]]; then
|
||||
echo "[INFO] TLS cert found, launching in HTTPS mode"
|
||||
exec minio server "$DATA_DIR" --address ":9000" --console-address ":9001" --certs-dir /ssl
|
||||
bashio::log.info "Starting MinIO (user: ${ACCESS_KEY}, region: ${MINIO_REGION}, bucket: ${BUCKET})"
|
||||
if bashio::fs.file_exists '/ssl/cert.pem' && bashio::fs.file_exists '/ssl/key.pem'; then
|
||||
bashio::log.info "TLS cert found, launching HTTPS"
|
||||
exec minio server "${DATA_DIR}" \
|
||||
--address ":9000" \
|
||||
--console-address ":9001" \
|
||||
--certs-dir /ssl
|
||||
else
|
||||
echo "[INFO] Launching in HTTP mode"
|
||||
exec minio server "$DATA_DIR" --address ":9000" --console-address ":9001"
|
||||
fi
|
||||
bashio::log.info "Launching HTTP"
|
||||
exec minio server "${DATA_DIR}" \
|
||||
--address ":9000" \
|
||||
--console-address ":9001"
|
||||
fi
|
||||
Reference in New Issue
Block a user