Skip to content

Commit c445f0d

Browse files
author
Aisura
committed
Initial commit: minio-mc-env-loader following minio-env-loader pattern
0 parents  commit c445f0d

4 files changed

Lines changed: 117 additions & 0 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build and Push minio-mc-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_MC_VERSION="RELEASE.2025-03-12T17-29-24Z"
37+
REGISTRY="us-docker.pkg.dev/hasura-ddn/ddn"
38+
echo "image=${REGISTRY}/minio-mc:${MINIO_MC_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 }}
48+
build-args: |
49+
MINIO_MC_VERSION=${{ env.MINIO_MC_VERSION }}

Dockerfile_EnvLoader

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
ARG MINIO_MC_VERSION=RELEASE.2025-03-12T17-29-24Z
2+
FROM us-docker.pkg.dev/hasura-ddn/ddn/lux-env-loader-entrypoint:20250508.rc1 AS utilsource
3+
4+
FROM minio/mc:${MINIO_MC_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 mc entrypoint
12+
ENTRYPOINT ["/usr/local/bin/env-loader-entrypoint.sh", "mc"]

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_MC_VERSION ?= RELEASE.2025-03-12T17-29-24Z
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_MC_VERSION=$(MINIO_MC_VERSION) \
11+
-t $(REGISTRY)/minio-mc:$(MINIO_MC_VERSION)-env-loader \
12+
-f Dockerfile_EnvLoader .
13+
14+
.PHONY: push-env-loader
15+
push-env-loader:
16+
docker push $(REGISTRY)/minio-mc:$(MINIO_MC_VERSION)-env-loader
17+
18+
.PHONY: env-loader
19+
env-loader: build-env-loader push-env-loader

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# minio-mc-env-loader
2+
3+
A Docker image that wraps `minio/mc:RELEASE.2025-03-12T17-29-24Z` with the [lux-env-loader-entrypoint](https://github.com/hasura/lux-env-loader-entrypoint) utility, enabling MinIO Client (`mc`) 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 `mc` 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 `mc` 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_MC_VERSION=RELEASE.2025-03-12T17-29-24Z
31+
```
32+
33+
## Image Reference
34+
35+
Base image: `minio/mc:RELEASE.2025-03-12T17-29-24Z`
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-mc:RELEASE.2025-03-12T17-29-24Z-env-loader`

0 commit comments

Comments
 (0)