From 7ab1f2c3d074a26142116e3b700bd332ce6efe1d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2026 07:19:00 +0000 Subject: [PATCH 1/2] chore(main): release 0.4.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 14 ++++++++++++++ Sources/Mocker/Commands/Version.swift | 2 +- Tests/MockerTests/CLITests.swift | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0477999..2537c1f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.3.2" + ".": "0.4.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 05cea3e..1e05e73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * **image inspect:** `mocker image inspect` and `mocker inspect --type=image` now return Docker-compatible `ImageInspect` JSON arrays with PascalCase keys instead of the previous lowercase `ImageInfo` object shape. * **MockerKit:** `ImageManager.inspect(_:platform:)` returns `ImageInspect` instead of `ImageInfo`. +## [0.4.0](https://github.com/us/mocker/compare/v0.3.2...v0.4.0) (2026-06-16) + + +### ⚠ BREAKING CHANGES + +* image inspect output now uses the Docker ImageInspect shape — a JSON array of objects with PascalCase keys (Id, RepoTags, Created, Size, Config, RootFS, ...) instead of a single object with lowercase keys (id, repository, tag, size, created, labels). The Id field now reports the image config digest (Docker parity) rather than the index digest, so it differs from 'mocker images'. MockerKit consumers: ImageManager.inspect(_:) now returns ImageInspect (was ImageInfo) and takes an optional platform: argument. + +### Bug Fixes + +* add Docker-compatible ImageInspect model and mapping ([aa318d5](https://github.com/us/mocker/commit/aa318d538cf7b7128ccb8b5cb12487971914c9d9)) +* address image inspect review feedback ([8c6c5ec](https://github.com/us/mocker/commit/8c6c5ec3af2df20366b81eeefa84f53b87df7c3c)) +* **compose:** forward published ports ([#19](https://github.com/us/mocker/issues/19)) and accept -f before subcommand ([#21](https://github.com/us/mocker/issues/21)) ([#22](https://github.com/us/mocker/issues/22)) ([5255e50](https://github.com/us/mocker/commit/5255e503044246c80d6076f008f2dc4ac6d0e323)) +* make image inspect Docker-compatible and honor --type ([2b80af3](https://github.com/us/mocker/commit/2b80af3862298a5f66dfa5332b88f4b62f673772)) + ## [0.3.2](https://github.com/us/mocker/compare/v0.3.1...v0.3.2) (2026-06-11) diff --git a/Sources/Mocker/Commands/Version.swift b/Sources/Mocker/Commands/Version.swift index e083c00..891370c 100644 --- a/Sources/Mocker/Commands/Version.swift +++ b/Sources/Mocker/Commands/Version.swift @@ -7,7 +7,7 @@ struct Version: AsyncParsableCommand { ) // x-release-please-start-version - static let currentVersion = "0.3.2" + static let currentVersion = "0.4.0" // x-release-please-end @Option(name: .shortAndLong, help: "Format output using a custom template") diff --git a/Tests/MockerTests/CLITests.swift b/Tests/MockerTests/CLITests.swift index 045efd7..eff8b77 100644 --- a/Tests/MockerTests/CLITests.swift +++ b/Tests/MockerTests/CLITests.swift @@ -9,7 +9,7 @@ struct CLITests { let version = Version.currentVersion #expect(!version.isEmpty) // x-release-please-start-version - #expect(version == "0.3.2") + #expect(version == "0.4.0") // x-release-please-end } From ea61c8338c10ece096403277c53f8868e37411f3 Mon Sep 17 00:00:00 2001 From: us Date: Tue, 16 Jun 2026 10:23:49 +0300 Subject: [PATCH 2/2] docs: update readme for 0.4.0 release --- README.md | 7 +++++++ README.zh-CN.md | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/README.md b/README.md index 7a55f1e..f445de9 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,13 @@ Your existing `docker-compose.yml` works as-is. ## What's New +### v0.4.0 — Docker-compatible image inspect +- **Docker-compatible `ImageInspect` output** — `mocker image inspect` and `mocker inspect --type image` now emit the same Docker-shaped JSON array with PascalCase keys. +- **Real image metadata** — image inspect now reads OCI manifest/config data for `Size`, `Created`, `Architecture`, `Os`, `Config`, `RootFS`, repo tags, and repo digests instead of returning stubbed values. +- **Inspect routing fixes** — `mocker inspect --type image|container` now validates type values, and `--platform` is honored for image inspection. +- **Compose fixes** — published ports are forwarded correctly and `compose -f ... up` works when `-f` appears before the subcommand. +- **BREAKING**: image inspect output changed from the old lowercase `ImageInfo` object shape to Docker-compatible `ImageInspect` arrays; `MockerKit.ImageManager.inspect(_:platform:)` now returns `ImageInspect`. + ### v0.3.0 — Multi-arch images - **`mocker manifest`** subcommand group — `create`, `inspect`, `add`, `rm`, `annotate`, `push` for assembling and publishing OCI image indexes (multi-arch manifest lists). Pure-Swift via Containerization, no skopeo required (closes #9, #11) - **Multi-platform builds** — `mocker build --platform linux/amd64 --platform linux/arm64 -t img:tag .` produces a single multi-arch image diff --git a/README.zh-CN.md b/README.zh-CN.md index 01f1094..63740ca 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -37,6 +37,13 @@ mocker exec -it my-app sh ## 最新更新 +### v0.4.0 — Docker 兼容的镜像检查 +- **Docker 兼容的 `ImageInspect` 输出** — `mocker image inspect` 和 `mocker inspect --type image` 现在输出相同的 Docker 风格 JSON 数组,并使用 PascalCase 字段名。 +- **真实镜像元数据** — 镜像检查会读取 OCI manifest/config 中的 `Size`、`Created`、`Architecture`、`Os`、`Config`、`RootFS`、repo tags 和 repo digests,不再返回占位值。 +- **Inspect 路由修复** — `mocker inspect --type image|container` 会校验类型值,镜像检查也会正确处理 `--platform`。 +- **Compose 修复** — 发布端口会被正确转发,且 `compose -f ... up` 支持在子命令前传入 `-f`。 +- **BREAKING**:镜像检查输出从旧的 lowercase `ImageInfo` 对象变为 Docker 兼容的 `ImageInspect` 数组;`MockerKit.ImageManager.inspect(_:platform:)` 现在返回 `ImageInspect`。 + ### v0.2.1 — 嵌套虚拟化 - **`--virtualization` / `--kernel`** 适用于 `mocker run` 和 `mocker create` — 向容器暴露嵌套虚拟化能力(closes #4)