Repository navigation
Conversation
`mocker build` declared `-t/--tag` as a single required option, so the everyday `docker build .` failed with "Missing expected argument '--tag <tag>'", and `-t app:1.0 -t app:latest` silently kept only the last tag. `container build` itself supports both: repeated `-t`, and no `-t` at all (it names the image after a random UUID). - `-t` is now optional and repeatable; extra tags are forwarded to `container build` as additional `-t` flags. - Without `-t`, mocker picks the same `<uuid>:latest` name `container build` would, so the built image can still be looked up afterwards. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Owner
|
hey @BluPix thanks for this great pr, will review soon and merge! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
mocker builddeclares-t/--tagas a single, required option. That breaks two everyday Docker usages:In Docker,
-tis optional and can be repeated.container buildsupports both as well: it accepts repeated-t, and without-tit names the image after a random UUID. Only mocker's option declaration got in the way.Change
Build.tagis now[String], so-tcan be omitted or repeated. The extra tags are passed through a newextraTags:parameter (default[]) onImageManager.build/makeBuildArgumentsas additional-tflags. Existing callers are unchanged.-tis given, mocker picks the same<uuid>:latestname thatcontainer buildwould use. Mocker chooses the name itself so it can still look up the built image and report its ID.Successfully taggedis printed once per tag given on the command line, and not at all for an untagged build, as in Docker.Tests
--tagis optional and repeatable.-tflags.swift buildandswift testpass.container1.5.0:mocker build .builds and stores<uuid>:latest.mocker build -t a:1 -t b:2 .creates both tags on the same digest.Separately,
mocker build -qhangs. That is upstream incontainer build -q(apple/container#2387, fix in apple/container#2388), not in this change.🤖 Generated with Claude Code