Skip to content

Commit 05281d5

Browse files
committed
docs: Add reference documentation (manual page) for plugin
1 parent 3326f8f commit 05281d5

File tree

3 files changed

+92
-43
lines changed

3 files changed

+92
-43
lines changed

Sources/containertool/Documentation.docc/containertool.md

Lines changed: 0 additions & 43 deletions
This file was deleted.

Sources/swift-container-plugin/Documentation.docc/Swift-Container-Plugin.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,6 @@ Take a look at some [other examples](https://github.com/apple/swift-container-pl
7777
### Building and running
7878
- <doc:build>
7979
- <doc:run>
80+
81+
### Reference
82+
- <doc:build-container-image>
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# build-container-image plugin
2+
3+
Wrap a binary in a container image and publish it.
4+
5+
## Overview
6+
7+
`build-container-image` is a Swift Package Manager [command plugin](https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/Plugins.md#using-a-package-plugin) which packages a product defined in `Package.swift` in a container image and publishes it to repository on a container registry.
8+
9+
### Usage
10+
11+
`swift package build-container-image [<options>] --repository <repository>`
12+
13+
### Options
14+
15+
- term `--product <product>`:
16+
The name of the product to package.
17+
18+
If `Package.swift` defines only one product, it will be selected by default.
19+
20+
- term `--default-registry <default-registry>`:
21+
The default registry hostname. (default: `docker.io`)
22+
23+
If the value of the `--repository` argument does not contain a registry hostname, the default registry will be prepended to the repository path.
24+
25+
- term `--repository <repository>`:
26+
The repository path.
27+
28+
If the path does not begin with a registry hostname, the default registry will be prepended to the path.
29+
30+
- term `--resources <resources>`:
31+
Add the file or directory at `resources` to the image.
32+
Directories are added recursively.
33+
34+
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.
35+
36+
- term `--username <username>`:
37+
Username to use when logging into the registry.
38+
39+
The same username is used for the source and destination registries.
40+
The `.netrc` file is ignored when this option is specified.
41+
42+
- term `--password <password>`:
43+
Password to use when logging into the registry.
44+
45+
The same password is used for the source and destination registries.
46+
The `.netrc` file is ignored when this option is specified.
47+
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+
- term `--os <os>`:
61+
Operating system to record in the image. (default: `linux`)
62+
63+
- term `--tag <tag>`:
64+
Tag for this manifest.
65+
66+
The `latest` tag is automatically updated to refer to the published image.
67+
68+
- term `--enable-netrc/--disable-netrc`:
69+
Load credentials from a netrc file (default: `--enable-netrc`)
70+
71+
- term `--netrc-file <netrc-file>`:
72+
The path to the `.netrc` file.
73+
74+
- term `-h, --help`:
75+
Show help information.
76+
77+
### Environment
78+
79+
- term `CONTAINERTOOL_DEFAULT_REGISTRY`:
80+
Default image registry hostname, used when the `--repository` argument does not contain a registry hostname.
81+
(default: `docker.io`)
82+
83+
- term `CONTAINERTOOL_BASE_IMAGE`:
84+
Base image on which to layer the application.
85+
(default: `swift:slim`)
86+
87+
- term `CONTAINERTOOL_OS`:
88+
Operating system to encode in the container image.
89+
(default: `Linux`)

0 commit comments

Comments
 (0)