Skip to content

Commit 87a6ae1

Browse files
committed
docs: Add a plugin workflow diagram to README
1 parent 25cc778 commit 87a6ae1

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,16 @@ 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.
16+
17+
![Swift Container Plugin flow diagram](Sources/swift-container-plugin/Documentation.docc/_Resources/swift-container-plugin-flow-diagram.png)
18+
19+
1. [Add `swift-container-plugin` to your project's dependencies](doc:Adding-the-plugin-to-your-project) in `Package.swift`.
20+
2. [Build your project](doc:build) using Swift Package Manager.
21+
- If you are building on macOS, [use a Swift SDK](doc:requirements) to build 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. `swift-container-plugin` automatically packages your executable in a container image and publishes it to a container registry.
24+
4. [Run your container image](doc:run) on any container-based platform.
1625

1726
Find out more and see it in action:
1827

@@ -25,7 +34,8 @@ Swift Container Plugin can package any executable product defined in `Package.sw
2534

2635
### Build and publish a container image
2736

28-
After adding the plugin to your project, you can build and publish a container image in one step:
37+
After adding the plugin to your project, you can build and publish a container image in one step.
38+
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:
2939

3040
```
3141
% swift package --swift-sdk x86_64-swift-linux-musl \
@@ -52,7 +62,7 @@ registry.example.com/myservice@sha256:a3f75d0932d052dd9d448a1c9040b16f9f2c2ed919
5262

5363
### Run the image
5464

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

5767
```
5868
% podman run -p 8080:8080 registry.example.com/myservice@sha256:a3f75d0932d052dd9d448a1c9040b16f9f2c2ed9190317147dee95a218faf1df
@@ -67,8 +77,12 @@ Trying to pull registry.example.com/myservice@sha256:a3f75d0932d052dd9d448a1c904
6777
* 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.
6878
* A container runtime is not required to build an image, but one must be available wherever the image is to be run.
6979

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

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

74-
Take a look at the [Examples](Examples).
87+
* [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/).
88+
* [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/).

0 commit comments

Comments
 (0)