change to debian base
This commit is contained in:
@@ -1,19 +1,20 @@
|
|||||||
FROM homeassistant/amd64-addon-base:latest
|
FROM debian:stable-slim
|
||||||
|
|
||||||
LABEL io.hass.name="MinIO"
|
LABEL io.hass.name="MinIO"
|
||||||
LABEL io.hass.description="S3-compatible object storage for HA"
|
LABEL io.hass.description="S3-compatible object storage for HA"
|
||||||
LABEL io.hass.arch="amd64|aarch64"
|
LABEL io.hass.arch="amd64|aarch64"
|
||||||
LABEL io.hass.type="addon"
|
LABEL io.hass.type="addon"
|
||||||
LABEL io.hass.version="1.0.62"
|
LABEL io.hass.version="1.0.63"
|
||||||
|
|
||||||
# Install curl and download MinIO binary
|
# Install curl and jq then download MinIO binary
|
||||||
# https://min.io/download#/linux
|
# https://min.io/download#/linux
|
||||||
# https://docs.min.io/docs/minio-server-quickstart-guide.html
|
# https://docs.min.io/docs/minio-server-quickstart-guide.html
|
||||||
RUN apk add --no-cache curl \
|
RUN apt update && \
|
||||||
&& curl -fsSL https://dl.min.io/server/minio/release/linux-amd64/minio \
|
apt install -y --no-install-recommends curl jq && \
|
||||||
-o /usr/local/bin/minio \
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
&& chmod +x /usr/local/bin/minio \
|
curl -fsSL https://dl.min.io/server/minio/release/linux-amd64/minio \
|
||||||
&& apk del curl
|
-o /usr/local/bin/minio && \
|
||||||
|
chmod +x /usr/local/bin/minio
|
||||||
|
|
||||||
# Copy the script into the container
|
# Copy the script into the container
|
||||||
# make it executable and run it
|
# make it executable and run it
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "MinIO S3 Server",
|
"name": "MinIO S3 Server",
|
||||||
"version": "1.0.62",
|
"version": "1.0.63",
|
||||||
"slug": "minio",
|
"slug": "minio",
|
||||||
"description": "MinIO Server S3-compatible object storage server",
|
"description": "MinIO Server S3-compatible object storage server",
|
||||||
"arch": [
|
"arch": [
|
||||||
@@ -37,6 +37,7 @@
|
|||||||
"bucket": "str"
|
"bucket": "str"
|
||||||
},
|
},
|
||||||
"build_from": {
|
"build_from": {
|
||||||
"amd64": "homeassistant/amd64-addon-base:latest"
|
"amd64": "debian:stable-slim",
|
||||||
|
"aarch64": "debian:stable-slim"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
34
minio/run.sh
34
minio/run.sh
@@ -1,16 +1,19 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
bashio::log.info "Run script started"
|
echo "[DEBUG] Run script started"
|
||||||
|
|
||||||
|
CONFIG="/data/options.json"
|
||||||
|
|
||||||
# Config via HA options
|
# Config via HA options
|
||||||
ACCESS_KEY=$(bashio::config 'access_key')
|
ACCESS_KEY=$(jq -r .access_key "$CONFIG")
|
||||||
SECRET_KEY=$(bashio::config 'secret_key')
|
SECRET_KEY=$(jq -r .secret_key "$CONFIG")
|
||||||
REGION=$(bashio::config 'region')
|
REGION=$(jq -r .region "$CONFIG")
|
||||||
BUCKET=$(bashio::config 'bucket')
|
BUCKET=$(jq -r .bucket "$CONFIG")
|
||||||
|
|
||||||
|
|
||||||
# Config via env vars (for docker container)
|
# Config via env vars (for docker container)
|
||||||
export MINIO_ROOT_USER="${ACCESS_KEY}"
|
export MINIO_ROOT_USER="$ACCESS_KEY"
|
||||||
export MINIO_ROOT_PASSWORD="${SECRET_KEY}"
|
export MINIO_ROOT_PASSWORD="$SECRET_KEY"
|
||||||
export MINIO_REGION="${REGION:-us-east-1}"
|
export MINIO_REGION="${REGION:-us-east-1}"
|
||||||
|
|
||||||
|
|
||||||
@@ -19,19 +22,20 @@ CERT_PATH="/ssl/cert.pem"
|
|||||||
KEY_PATH="/ssl/key.pem"
|
KEY_PATH="/ssl/key.pem"
|
||||||
|
|
||||||
# First-run: make sure bucket exists (done via client)
|
# First-run: make sure bucket exists (done via client)
|
||||||
DATA_DIR="/data/${BUCKET}"
|
DATA_DIR="/data/$BUCKET"
|
||||||
mkdir -p "${DATA_DIR}"
|
mkdir -p "$DATA_DIR"
|
||||||
|
|
||||||
bashio::log.info "Starting MinIO (user: ${ACCESS_KEY}, region: ${MINIO_REGION}, bucket: ${BUCKET})"
|
echo "[INFO] Starting MinIO (user: $MINIO_ROOT_USER, 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"
|
if [[ -f "$CERT_PATH" && -f "$KEY_PATH" ]]; then
|
||||||
exec minio server "${DATA_DIR}" \
|
echo "[INFO] TLS cert found, launching in HTTPS mode"
|
||||||
|
exec minio server "$DATA_DIR" \
|
||||||
--address ":9000" \
|
--address ":9000" \
|
||||||
--console-address ":9001" \
|
--console-address ":9001" \
|
||||||
--certs-dir /ssl
|
--certs-dir /ssl
|
||||||
else
|
else
|
||||||
bashio::log.info "Launching HTTP"
|
echo "[INFO] Launching in HTTP mode"
|
||||||
exec minio server "${DATA_DIR}" \
|
exec minio server "$DATA_DIR" \
|
||||||
--address ":9000" \
|
--address ":9000" \
|
||||||
--console-address ":9001"
|
--console-address ":9001"
|
||||||
fi
|
fi
|
||||||
Reference in New Issue
Block a user