Skip to content

Commit 7485dc4

Browse files
dliubclaude
andcommitted
Initial commit: minio-env-loader
Adds Dockerfile_EnvLoader, Makefile, README, and CI workflow following the same pattern as hasura/postgres-env-loader and hasura/redis-env-loader. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0 parents  commit 7485dc4

4 files changed

Lines changed: 119 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build and Push minio-env-loader
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '*'
9+
10+
jobs:
11+
build-and-push:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
id-token: write
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Authenticate to Google Cloud
22+
uses: google-github-actions/auth@v2
23+
with:
24+
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
25+
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
30+
- name: Configure Docker for GCP Artifact Registry
31+
run: gcloud auth configure-docker us-docker.pkg.dev --quiet
32+
33+
- name: Set image tag
34+
id: tag
35+
run: |
36+
MINIO_VERSION="RELEASE.2024-01-18T22-51-28Z"
37+
REGISTRY="us-docker.pkg.dev/hasura-ddn/ddn"
38+
echo "image=${REGISTRY}/minio:${MINIO_VERSION}-env-loader" >> "$GITHUB_OUTPUT"
39+
40+
- name: Build and push
41+
uses: docker/build-push-action@v6
42+
with:
43+
context: .
44+
file: Dockerfile_EnvLoader
45+
platforms: linux/amd64
46+
push: true
47+
tags: ${{ steps.tag.outputs.image }}

Dockerfile_EnvLoader

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
ARG MINIO_VERSION=RELEASE.2024-01-18T22-51-28Z
2+
FROM us-docker.pkg.dev/hasura-ddn/ddn/lux-env-loader-entrypoint:20250508.rc1 AS utilsource
3+
4+
FROM minio/minio:${MINIO_VERSION}
5+
6+
# Copy env-loader utilities from utilsource
7+
COPY --from=utilsource /usr/local/bin/docker-entrypoint.sh /usr/local/bin/env-loader-entrypoint.sh
8+
COPY --from=utilsource /app/jq /usr/local/bin/jq
9+
COPY --from=utilsource /usr/local/bin/inotifywait /usr/local/bin/inotifywait
10+
11+
# Wrap the minio entrypoint
12+
ENTRYPOINT ["/usr/local/bin/env-loader-entrypoint.sh", "minio"]

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.EXPORT_ALL_VARIABLES:
2+
3+
VERSION ?= $(shell date +"%Y%m%d")
4+
MINIO_VERSION ?= RELEASE.2024-01-18T22-51-28Z
5+
REGISTRY ?= us-docker.pkg.dev/hasura-ddn/ddn
6+
7+
.PHONY: build-env-loader
8+
build-env-loader:
9+
docker build --platform=linux/amd64 \
10+
--build-arg MINIO_VERSION=$(MINIO_VERSION) \
11+
-t $(REGISTRY)/minio:$(MINIO_VERSION)-env-loader \
12+
-f Dockerfile_EnvLoader .
13+
14+
.PHONY: push-env-loader
15+
push-env-loader:
16+
docker push $(REGISTRY)/minio:$(MINIO_VERSION)-env-loader
17+
18+
.PHONY: env-loader
19+
env-loader: build-env-loader push-env-loader

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# minio-env-loader
2+
3+
A Docker image that wraps `minio/minio:RELEASE.2024-01-18T22-51-28Z` with the [lux-env-loader-entrypoint](https://github.com/hasura/lux-env-loader-entrypoint) utility, enabling MinIO to load environment variables from external secrets files at startup.
4+
5+
## Purpose
6+
7+
This image is designed for environments where secrets are delivered as JSON files (e.g., mounted from a Kubernetes secret or a cloud secrets manager) rather than as plain environment variables. The env-loader reads `/secrets/*.json` at startup, exports the key-value pairs as environment variables, and then delegates to the original MinIO entrypoint.
8+
9+
## How It Works
10+
11+
1. The container starts with `env-loader-entrypoint.sh` as its entrypoint.
12+
2. The entrypoint reads all `*.json` files under `/secrets/` and exports each top-level key as an environment variable.
13+
3. Control is then handed to `minio` as the default command.
14+
15+
## Building Locally
16+
17+
```bash
18+
make build-env-loader
19+
```
20+
21+
To build and push:
22+
23+
```bash
24+
make env-loader
25+
```
26+
27+
Override the registry or version:
28+
29+
```bash
30+
make env-loader REGISTRY=my-registry MINIO_VERSION=RELEASE.2024-01-18T22-51-28Z
31+
```
32+
33+
## Image Reference
34+
35+
Base image: `minio/minio:RELEASE.2024-01-18T22-51-28Z`
36+
Env-loader source: `us-docker.pkg.dev/hasura-ddn/ddn/lux-env-loader-entrypoint:20250508.rc1`
37+
Published image: `us-docker.pkg.dev/hasura-ddn/ddn/minio:RELEASE.2024-01-18T22-51-28Z-env-loader`
38+
39+
## Co-authors
40+
41+
Co-authored-by: Tomasz Skawinski <tom@hasura.io>

0 commit comments

Comments
 (0)