Skip to content

Commit bf67ac9

Browse files
euanhheckj
andauthored
Apply suggestions from code review
Co-authored-by: Joseph Heck <[email protected]>
1 parent 48aaaeb commit bf67ac9

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ Find out more and see it in action:
1919

2020
## Usage
2121

22-
Swift Container Plugin can package any executable product defined in `Package.swift` in a container image and publish it to a container registry.
22+
Use the Swift Container Plugin to package an executable product from your Swift package into a container image and publish it to a container registry.
2323

24+
To use the plugin:
25+
- <doc:Adding-the-plugin-to-your-project>
26+
- <doc:requirements>
27+
- <doc:authentication>
2428
### Build and publish a container image
2529

2630
After adding the plugin to your project, you can build and publish a container image in one step:

Sources/swift-container-plugin/Documentation.docc/authentication.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# Set up your registry credentials
22

3-
Configure Swift Container Plugin to authenticate to your container registry
3+
Configure the plugin to authenticate to your container registry.
44

55
## Overview
66

7-
Many registries require authentication in order to push images, or even pull them. The plugin can read your registry credentials from a `.netrc` file in your home directory. You can add a netrc record for each registry you need to use, and the plugin will choose the correct one:
7+
Many container registries require authentication in order to push images, or even pull them.
8+
The plugin reads your registry credentials from a `.netrc` file in your home directory.
9+
Add a record into the `.netrc` file for each registry you use, the plugin uses the authentication by the registry you choose.
10+
11+
The following example shows placeholder values for the registry `registry.example.com`:
812

913
```
1014
machine registry.example.com

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
## Overview
44

5-
`build-container-image` is a command plugin which takes care of building your service, packaging it in a container image and uploading it to a container registry, all in one command:
5+
The plugin exposes the command `build-container-image` which you invoke to build your service, package it in a container image and upload it to a container registry, in a single command:
66

77
```shell
88
% swift package --swift-sdk x86_64-swift-linux-musl \
99
build-container-image --from swift:slim --repository registry.example.com/myservice
1010
```
1111

12-
* The `--swift-sdk` argument specifies the Swift SDK with which to build the executable. In this case we are using the Static Linux SDK, which was installed earlier, to build an statically-linked x86_64 Linux binary
12+
* The `--swift-sdk` argument specifies the Swift SDK with which to build the executable. In this case we are using the Static Linux SDK, installed earlier, to build an statically-linked x86_64 Linux binary.
1313
* The `--from` argument specifies the base image on which our service will run. `swift:slim` is the default, but you can choose your own base image or use `scratch` if your service does not require a base image at all.
1414
* The `--repository` argument specifies where the plugin will upload our finished image.
1515

16-
The plugin needs permission to connect to the network to publish the image to the registry:
16+
> Note: on macOS, the plugin needs permission to connect to the network to publish the image to the registry.
1717
1818
```
1919
Plugin ‘ContainerImageBuilder’ wants permission to allow all network connections on all ports.
@@ -39,4 +39,5 @@ Build of product 'hello-world' complete! (5.51s)
3939
registry.example.com/myservice@sha256:a3f75d0932d052dd9d448a1c9040b16f9f2c2ed9190317147dee95a218faf1df
4040
```
4141

42-
When it finishes, the plugin prints a reference identifying the new image. Any standard container runtime can use the reference to pull and run your service.
42+
When the plugin finishes, it prints a reference identifying the new image.
43+
Any standard container runtime can use the reference to pull and run your service.

Sources/swift-container-plugin/Documentation.docc/requirements.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Install a toolchain for cross-compilation (macOS)
1+
# Install a toolchain for cross-compilation
22

3-
The open source Swift toolchain and a compatible Swift SDK make it possible to build Linux executables on macOS
3+
Install an open source Swift toolchain and a compatible Swift SDK to build Linux executables on macOS.
44

55
## Overview
66

@@ -20,7 +20,7 @@ If you are running on macOS, you can use a [Swift SDK](https://github.com/apple/
2020
* Install the [Static Linux SDK from swift.org](https://www.swift.org/documentation/articles/static-linux-getting-started.html)
2121
* Use [Swift SDK Generator](https://github.com/apple/swift-sdk-generator) to build and install a custom SDK
2222

23-
Let's install the Swift Static Linux SDK:
23+
The following example illustrates installing the Swift Static Linux SDK:
2424
```
2525
% swift sdk install https://download.swift.org/swift-6.1-release/static-sdk/swift-6.1-RELEASE/swift-6.1-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz --checksum 111c6f7d280a651208b8c74c0521dd99365d785c1976a6e23162f55f65379ac6
2626
Downloading a Swift SDK bundle archive from `https://download.swift.org/swift-6.1-release/static-sdk/swift-6.1-RELEASE/swift-6.1-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz`...
@@ -35,7 +35,7 @@ Swift SDK bundle at `https://download.swift.org/swift-6.1-release/static-sdk/swi
3535
Swift SDK bundle at `https://download.swift.org/swift-6.1-release/static-sdk/swift-6.1-RELEASE/swift-6.1-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz` successfully installed as swift-6.1-RELEASE_static-linux-0.0.1.artifactbundle.
3636
```
3737

38-
Check that the new Swift SDK is now available:
38+
After the installation is complete, check that the SDK is available:
3939

4040
```shell
4141
% swift sdk list

0 commit comments

Comments
 (0)