Skip to content

Commit 2d09732

Browse files
committed
docs: Rearrange options on build-container-image manual page to match --help
1 parent d024470 commit 2d09732

File tree

1 file changed

+39
-27
lines changed

1 file changed

+39
-27
lines changed

Sources/swift-container-plugin/Documentation.docc/build-container-image.md

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Wrap a binary in a container image and publish it.
88

99
### Usage
1010

11-
`swift package build-container-image [<options>] --repository <repository>`
11+
`swift package build-container-image [<options>]`
1212

1313
### Options
1414

@@ -17,22 +17,47 @@ Wrap a binary in a container image and publish it.
1717

1818
If `Package.swift` defines only one product, it will be selected by default.
1919

20+
### Source and destination repository options
21+
2022
- term `--default-registry <default-registry>`:
2123
The default registry hostname. (default: `docker.io`)
2224

2325
If the repository path does not contain a registry hostname, the default registry will be prepended to it.
2426

2527
- term `--repository <repository>`:
26-
The repository path.
28+
Destination image repository.
2729

28-
If the path does not begin with a registry hostname, the default registry will be prepended to the path.
30+
If the repository path does not begin with a registry hostname, the default registry will be prepended to the path.
31+
The destination repository must be specified, either by setting the `--repository` option or the `CONTAINERTOOL_REPOSITORY` environment variable.
32+
33+
- term `--tag <tag>`:
34+
Destination image tag.
35+
36+
The `latest` tag is automatically updated to refer to the published image.
37+
38+
- term `--from <from>`:
39+
Base image reference. (default: `swift:slim`)
40+
41+
### Image build options
2942

3043
- term `--resources <resources>`:
3144
Add the file or directory at `resources` to the image.
3245
Directories are added recursively.
3346

3447
If the `product` being packaged has a [resource bundle](https://developer.apple.com/documentation/xcode/bundling-resources-with-a-swift-package) it will be added to the image automatically.
3548

49+
### Image configuration options
50+
51+
- term `--architecture <architecture>`:
52+
CPU architecture required to run the image.
53+
54+
If the base image is `scratch`, the final image will have no base layer and will consist only of the application layer and resource bundle layer, if the product has a resource bundle.
55+
56+
- term `--os <os>`:
57+
Operating system required to run the image. (default: `linux`)
58+
59+
### Authentication options
60+
3661
- term `--default-username <username>`:
3762
Default username to use when logging into the registry.
3863

@@ -45,34 +70,20 @@ Wrap a binary in a container image and publish it.
4570
This password is used if there is no matching `.netrc` entry for the registry, there is no `.netrc` file, or the `--disable-netrc` option is set.
4671
The same password is used for the source and destination registries.
4772

48-
- term `-v, --verbose`:
49-
Verbose output.
50-
51-
- term `--allow-insecure-http <allow-insecure-http>`:
52-
Connect to the container registry using plaintext HTTP. (values: `source`, `destination`, `both`)
53-
54-
- term `--architecture <architecture>`:
55-
CPU architecture to record in the image.
56-
57-
- term `--from <from>`:
58-
Base image reference. (default: `swift:slim`)
59-
60-
If the base image is `scratch`, the final image will have no base layer and will consist only of the application layer and resource bundle layer, if the product has a resource bundle.
61-
62-
- term `--os <os>`:
63-
Operating system to record in the image. (default: `linux`)
64-
65-
- term `--tag <tag>`:
66-
Tag for this manifest.
67-
68-
The `latest` tag is automatically updated to refer to the published image.
69-
7073
- term `--enable-netrc/--disable-netrc`:
7174
Load credentials from a netrc file (default: `--enable-netrc`)
7275

7376
- term `--netrc-file <netrc-file>`:
7477
The path to the `.netrc` file.
7578

79+
- term `--allow-insecure-http <allow-insecure-http>`:
80+
Connect to the container registry using plaintext HTTP. (values: `source`, `destination`, `both`)
81+
82+
### Options
83+
84+
- term `-v, --verbose`:
85+
Verbose output.
86+
7687
- term `-h, --help`:
7788
Show help information.
7889

@@ -83,14 +94,15 @@ Wrap a binary in a container image and publish it.
8394
(default: `docker.io`)
8495

8596
- term `CONTAINERTOOL_REPOSITORY`:
86-
The repository path.
97+
The destination image repository.
8798

8899
If the path does not begin with a registry hostname, the default registry will be prepended to the path.
100+
The destination repository must be specified, either by setting the `--repository` option or the `CONTAINERTOOL_REPOSITORY` environment variable.
89101

90102
- term `CONTAINERTOOL_BASE_IMAGE`:
91103
Base image on which to layer the application.
92104
(default: `swift:slim`)
93105

94106
- term `CONTAINERTOOL_OS`:
95-
Operating system to encode in the container image.
107+
Operating system.
96108
(default: `Linux`)

0 commit comments

Comments
 (0)