Skip to content

Ministack: Free, open-source local AWS emulator - 60+ services, Terraform compatible, real databases. Free forever. MIT licensed.

Ship MySQL IAM plugins in slim image (#1463)

Ian Oberst06f50637c0f9
diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml
index c0e5e9ca..1499aa40 100644
--- a/.github/workflows/docker-publish.yml
+++ b/.github/workflows/docker-publish.yml
@@ -60,20 +60,6 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest
- - name: Build and push (regular)
- uses: docker/build-push-action@v5
- with:
- context: .
- file: Dockerfile
- platforms: linux/amd64,linux/arm64
- push: true
- tags: ${{ steps.meta.outputs.tags }}
- labels: ${{ steps.meta.outputs.labels }}
- build-args: |
- MINISTACK_VERSION=${{ steps.meta.outputs.version }}
- cache-from: type=gha,scope=regular
- cache-to: type=gha,mode=max,scope=regular
-
# ── Full (Debian/glibc) image — :full, :{version}-full, :{major}.{minor}-full ──
# Adds DuckDB (Athena engine), psycopg2-binary, pymysql. Larger
# image (~360 MB vs ~110 MB) but all manylinux wheels install
@@ -95,6 +81,7 @@ jobs:
type=raw,value=full
- name: Build and push (full)
+ id: build_full
uses: docker/build-push-action@v5
with:
context: .
@@ -107,3 +94,18 @@ jobs:
MINISTACK_VERSION=${{ steps.meta.outputs.version }}
cache-from: type=gha,scope=full
cache-to: type=gha,mode=max,scope=full
+
+ - name: Build and push (regular)
+ uses: docker/build-push-action@v5
+ with:
+ context: .
+ file: Dockerfile
+ platforms: linux/amd64,linux/arm64
+ push: true
+ tags: ${{ steps.meta.outputs.tags }}
+ labels: ${{ steps.meta.outputs.labels }}
+ build-args: |
+ MINISTACK_VERSION=${{ steps.meta.outputs.version }}
+ PLUGIN_DONOR_IMAGE=ghcr.io/ministackorg/ministack@${{ steps.build_full.outputs.digest }}
+ cache-from: type=gha,scope=regular
+ cache-to: type=gha,mode=max,scope=regular
diff --git a/Dockerfile b/Dockerfile
index f4b20618..5a5ae2d8 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,3 +1,8 @@
+# Non-release builds intentionally use the maintainer-requested fallback of the latest
+# published full image. Release builds override this in docker-publish.yml with the
+# same-release full-image digest; plugin-source PRs use the full-preview label path.
+ARG PLUGIN_DONOR_IMAGE=ghcr.io/ministackorg/ministack:full
+
FROM python:3.13-alpine AS builder
RUN pip install --no-cache-dir --no-compile \
@@ -18,6 +23,9 @@ RUN rm -rf /usr/local/lib/python3.13/site-packages/awscli/examples \
&& rm -rf /usr/local/lib/python3.13/site-packages/pip*.dist-info \
&& rm -rf /usr/local/lib/python3.13/site-packages/pip*
+# Plugin artifacts are release-stable; release builds pin this donor by digest.
+FROM ${PLUGIN_DONOR_IMAGE} AS plugin-donor
+
FROM python:3.13-alpine
LABEL maintainer="MiniStack" \
@@ -40,6 +48,7 @@ COPY bin/awslocal /usr/local/bin/awslocal
RUN chmod +x /usr/local/bin/awslocal
COPY ministack/ ministack/
+COPY --from=plugin-donor /opt/ministack/mysql-plugins /opt/ministack/mysql-plugins
RUN addgroup -S ministack && adduser -S ministack -G ministack
RUN mkdir -p /tmp/ministack-data/s3 && chown -R ministack:ministack /tmp/ministack-data
diff --git a/contrib/mysql-iam-plugin/README.md b/contrib/mysql-iam-plugin/README.md
index 8e2388e1..c4672696 100644
--- a/contrib/mysql-iam-plugin/README.md
+++ b/contrib/mysql-iam-plugin/README.md
@@ -38,10 +38,11 @@ repository root:
contrib/mysql-iam-plugin/build.sh
```
-This writes to `build/mysql-plugins` by default. The full Docker image places
-the same tree at `/opt/ministack/mysql-plugins`, the fixed runtime lookup path.
-Delivery and installation happen automatically when a matching bundled
-artifact exists and are silent when it is absent.
+This writes to `build/mysql-plugins` by default. `Dockerfile.full` compiles and
+places the tree at `/opt/ministack/mysql-plugins`; the slim image copies that
+tree from the same release's full image into the same fixed runtime lookup path.
+Delivery and installation happen automatically when a matching bundled artifact
+exists and are silent when it is absent.
Artifact series selection uses the tag of the same resolved MySQL image that
the RDS container launch uses. Accepted version prefixes such as Aurora MySQL
@@ -107,8 +108,8 @@ plugin is `ACTIVE` before reporting success. The maintenance session disables
binary logging at entry so every current and future plugin-metadata statement
remains compute-local and cannot alter a global-cluster secondary.
-Residuals: the full image carries the artifacts; the slim image remains
-artifact-free and therefore auto-off. The existing global-replication live
-fixture now asserts that an IAM user created on the primary reaches the
-secondary without breaking replication whenever artifacts are present. Each
-MySQL image-tag update must rebuild and reload-test its series artifact.
+Both image flavors carry the same artifacts; the slim image receives them from
+the same release's full image. The existing global-replication live fixture
+asserts that an IAM user created on the primary reaches the secondary without
+breaking replication whenever artifacts are present. Each MySQL image-tag
+update must rebuild and reload-test its series artifact.