Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,8 @@ mocker build [OPTIONS] PATH

### `mocker images`

List images.
List images. `SIZE` and `CREATED` are read from each image's manifest and config, and
render as `N/A` when that metadata is not present in the local content store.

```
mocker images [OPTIONS]
Expand Down Expand Up @@ -892,12 +893,18 @@ mocker system prune [OPTIONS]

## Compose

All compose subcommands support these shared flags:
All compose subcommands support these shared flags, before or after the subcommand:

| Flag | Short | Description |
|------|-------|-------------|
| `--file` | `-f` | Compose file path |
| `--project-name` | `-p` | Project name |
| `--project-directory` | | Working directory for relative paths and `.env` |
| `--dry-run` | | Print the actions that would be taken and change nothing |

The project name is resolved as `-p` → `COMPOSE_PROJECT_NAME` in the environment →
`COMPOSE_PROJECT_NAME` in `.env` → top-level `name:` in the compose file → the project
directory's name.

### `mocker compose up`

Expand Down Expand Up @@ -998,7 +1005,8 @@ mocker compose logs [OPTIONS] [SERVICE]

### `mocker compose build`

Build or rebuild services.
Build or rebuild services. Each image is tagged with the service's `image:` when set,
otherwise `<project>-<service>:latest`.

```
mocker compose build [OPTIONS] [SERVICE...]
Expand Down
7 changes: 5 additions & 2 deletions Sources/Mocker/Commands/Build.swift
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,13 @@ struct Build: AsyncParsableCommand {
labels: label, quiet: quiet, progress: progress, output: output,
builder: builder
)
// The build can succeed while the image is not readable from our store; report
// the tag rather than an empty ID in that case.
let identifier = image.id.isEmpty ? tag : image.shortID
if quiet {
print(image.shortID)
print(identifier)
} else {
print("Successfully built \(image.shortID)")
print("Successfully built \(identifier)")
print("Successfully tagged \(tag)")
}
}
Expand Down
Loading
Loading