Skip to content

Commit ed22afb

Browse files
committed
docs: Add a diagram giving an overview of the plugin workflow
Motivation ---------- On first visit to the repository or the documentation, it can be difficult to understand what the plugin does and how it fits into the development process. A flow diagram showing how the code is built, packaged, uploaded and deployed is much easier to read at a glance than a screen of example command output. The diagram can also provide a structure which can be referred to in the text. Modifications ------------- * Add a workflow diagram image * Rewrite the overview section of README.md and the DocC documentation entry point to include the image and expand on what happens in each step. Result ------ New visitors to the repository or the documentation will see a diagram which summarises what the plugin does and where it fits in the Swift Package Manager workflow. Test Plan --------- All existing tests continue to pass. Manually tested all new URLs.
1 parent 50dbfb6 commit ed22afb

File tree

3 files changed

+40
-23
lines changed

3 files changed

+40
-23
lines changed

README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,27 @@ Build and publish container images using Swift Package Manager.
1212

1313
Container images are the standard way to package cloud software today. Once you have packaged your server in a container image, you can deploy it on any container-based public or private cloud service, or run it locally using a desktop container runtime.
1414

15-
Swift Container Plugin makes it easy to build container images for servers written in Swift, using Swift Package Manager.
15+
Use Swift Container Plugin to build and publish container images for your Swift services in one streamlined workflow with Swift Package Manager.
1616

17-
Find out more and see it in action:
17+
![Swift Container Plugin flow diagram](Sources/swift-container-plugin/Documentation.docc/_Resources/swift-container-plugin-flow-diagram.png)
1818

19-
* [How to put Swift in a box](https://fosdem.org/2025/schedule/event/fosdem-2025-5116-how-to-put-swift-in-a-box-building-container-images-with-swift-container-plugin/) at [FOSDEM 2025](https://fosdem.org/2025/schedule/track/swift/).
20-
* [Swift to the cloud in a single step](https://www.youtube.com/watch?v=9AaINsCfZzw) at [ServerSide.Swift 2024](https://www.serversideswift.info/2024/speakers/euan-harris/).
19+
1. [Add the plugin to your project's dependencies](https://swiftpackageindex.com/apple/swift-container-plugin/main/documentation/swift-container-plugin/adding-the-plugin-to-your-project) in `Package.swift`.
20+
2. [Build and package your service](https://swiftpackageindex.com/apple/swift-container-plugin/main/documentation/swift-container-plugin/build) using Swift Package Manager.
21+
- If you are building on macOS, [use a Swift SDK](https://swiftpackageindex.com/apple/swift-container-plugin/main/documentation/swift-container-plugin/requirements) to cross-compile a Linux executable.
22+
- If you are building on Linux, use your native Swift compiler to build a Linux executable. If you have special requirements such as building a static executable, or cross-compiling to a different processor architecture, use a suitable Swift SDK.
23+
3. The plugin automatically packages your executable in a container image and publishes it to your chosen container registry.
24+
4. [Run your container image](https://swiftpackageindex.com/apple/swift-container-plugin/main/documentation/swift-container-plugin/run) on any container-based platform.
25+
26+
Find full details [in the documentation](https://swiftpackageindex.com/apple/swift-container-plugin/main/documentation/swift-container-plugin).
2127

2228
## Usage
2329

2430
Swift Container Plugin can package any executable product defined in `Package.swift` in a container image and publish it to a container registry.
2531

2632
### Build and publish a container image
2733

28-
After adding the plugin to your project, you can build and publish a container image in one step:
34+
After adding the plugin to your project, you can build and publish a container image in one step.
35+
Here is how to build the [HelloWorld example](https://github.com/apple/swift-container-plugin/tree/main/Examples/HelloWorldHummingbird) as a static executable for Linux running on the `x86_64` architecture:
2936

3037
```
3138
% swift package --swift-sdk x86_64-swift-linux-musl \
@@ -52,7 +59,7 @@ registry.example.com/myservice@sha256:a3f75d0932d052dd9d448a1c9040b16f9f2c2ed919
5259

5360
### Run the image
5461

55-
You can deploy your service in the cloud, or use a standards-compliant container runtime such as `podman` to run it locally:
62+
Deploy your service in the cloud, or use a standards-compliant container runtime to run it locally:
5663

5764
```
5865
% podman run -p 8080:8080 registry.example.com/myservice@sha256:a3f75d0932d052dd9d448a1c9040b16f9f2c2ed9190317147dee95a218faf1df
@@ -67,8 +74,12 @@ Trying to pull registry.example.com/myservice@sha256:a3f75d0932d052dd9d448a1c904
6774
* On macOS you must install a cross-compilation Swift SDK, such as the [Swift Static Linux SDK](https://www.swift.org/documentation/articles/static-linux-getting-started.html), in order to build executables which can run on Linux-based cloud infrastructure.
6875
* A container runtime is not required to build an image, but one must be available wherever the image is to be run.
6976

70-
## Getting Started
77+
### Find out more
78+
* Learn more about setting up your project in the [plugin documentation](https://swiftpackageindex.com/apple/swift-container-plugin/main/documentation/swift-container-plugin).
79+
80+
* Take a look at [more examples](https://github.com/apple/swift-container-plugin/tree/main/Examples).
7181

72-
Learn more about setting up your project in the [plugin documentation](https://swiftpackageindex.com/apple/swift-container-plugin/main/documentation/swift-container-plugin).
82+
* Watch some talks:
7383

74-
Take a look at the [Examples](Examples).
84+
* [How to put Swift in a box](https://fosdem.org/2025/schedule/event/fosdem-2025-5116-how-to-put-swift-in-a-box-building-container-images-with-swift-container-plugin/) at [FOSDEM 2025](https://fosdem.org/2025/schedule/track/swift/).
85+
* [Swift to the cloud in a single step](https://www.youtube.com/watch?v=9AaINsCfZzw) at [ServerSide.Swift 2024](https://www.serversideswift.info/2024/speakers/euan-harris/).

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

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,22 @@ Build and publish container images using Swift Package Manager.
1010

1111
Container images are the standard way to package cloud software today. Once you have packaged your server in a container image, you can deploy it on any container-based public or private cloud service, or run it locally using a desktop container runtime.
1212

13-
Swift Container Plugin makes it easy to build container images for servers written in Swift, using Swift Package Manager.
13+
Use Swift Container Plugin to build and publish container images for your Swift services in one streamlined workflow with Swift Package Manager.
1414

15-
Find out more and see it in action:
15+
![Swift Container Plugin flow diagram](swift-container-plugin-flow-diagram)
1616

17-
* [How to put Swift in a box](https://fosdem.org/2025/schedule/event/fosdem-2025-5116-how-to-put-swift-in-a-box-building-container-images-with-swift-container-plugin/) at [FOSDEM 2025](https://fosdem.org/2025/schedule/track/swift/).
18-
* [Swift to the cloud in a single step](https://www.youtube.com/watch?v=9AaINsCfZzw) at [ServerSide.Swift 2024](https://www.serversideswift.info/2024/speakers/euan-harris/).
17+
1. [Add the plugin to your project's dependencies](doc:Adding-the-plugin-to-your-project) in `Package.swift`.
18+
2. [Build and package your service](doc:build) using Swift Package Manager.
19+
- If you are building on macOS, [use a Swift SDK](doc:requirements) to cross-compile a Linux executable.
20+
- If you are building on Linux, use your native Swift compiler to build a Linux executable. If you have special requirements such as building a static executable, or cross-compiling to a different processor architecture, use a suitable Swift SDK.
21+
3. The plugin automatically packages your executable in a container image and publishes it to your chosen container registry.
22+
4. [Run your container image](doc:run) on any container-based platform.
1923

2024
### Usage
2125

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.
26+
Swift Container Plugin can package any executable product defined in `Package.swift`.
2327

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

3130
After adding the plugin to your project, you can build and publish a container image in one step.
3231
Here is how to build the [HelloWorld example](https://github.com/apple/swift-container-plugin/tree/main/Examples/HelloWorldHummingbird) as a static executable for Linux running on the `x86_64` architecture:
@@ -54,9 +53,9 @@ Build of product 'hello-world' complete! (5.51s)
5453
registry.example.com/myservice@sha256:a3f75d0932d052dd9d448a1c9040b16f9f2c2ed9190317147dee95a218faf1df
5554
```
5655

57-
### Run the image
56+
#### Run the image
5857

59-
You can deploy your service in the cloud, or use a standards-compliant container runtime such as `podman` to run it locally:
58+
Deploy your service in the cloud, or use a standards-compliant container runtime to run it locally:
6059

6160
```
6261
% podman run -p 8080:8080 registry.example.com/myservice@sha256:a3f75d0932d052dd9d448a1c9040b16f9f2c2ed9190317147dee95a218faf1df
@@ -65,7 +64,14 @@ Trying to pull registry.example.com/myservice@sha256:a3f75d0932d052dd9d448a1c904
6564
2024-05-26T22:57:50+0000 info HummingBird : [HummingbirdCore] Server started and listening on 0.0.0.0:8080
6665
```
6766

68-
Take a look at some [other examples](https://github.com/apple/swift-container-plugin/tree/main/Examples).
67+
### Find out more
68+
69+
* Take a look at [more examples](https://github.com/apple/swift-container-plugin/tree/main/Examples).
70+
71+
* Watch some talks:
72+
73+
* [How to put Swift in a box](https://fosdem.org/2025/schedule/event/fosdem-2025-5116-how-to-put-swift-in-a-box-building-container-images-with-swift-container-plugin/) at [FOSDEM 2025](https://fosdem.org/2025/schedule/track/swift/).
74+
* [Swift to the cloud in a single step](https://www.youtube.com/watch?v=9AaINsCfZzw) at [ServerSide.Swift 2024](https://www.serversideswift.info/2024/speakers/euan-harris/).
6975

7076
## Topics
7177

19.7 KB
Loading

0 commit comments

Comments
 (0)