You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Readme: Restructure and clarify requirements (#93)
Motivation
----------
_[Explain here the context, and why you're making that change. What is
the problem you're trying to solve.]_
Modifications
-------------
_[Describe the modifications you've made.]_
Result
------
_[After your change, what will change.]_
Test Plan
---------
_[Describe the steps you took, or will take, to qualify the change -
such as adjusting tests and manual testing.]_
Publish container images using Swift Package Manager.
9
+
Build and publish container images using Swift Package Manager.
10
10
11
-
Find out about Swift Container Plugin and see it in action:
11
+
## Overview
12
+
13
+
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.
14
+
15
+
Swift Container Plugin makes it easy to build container images for servers written in Swift, using Swift Package Manager.
16
+
17
+
Find out more and see it in action:
12
18
13
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/).
14
20
*[Swift to the cloud in a single step](https://www.youtube.com/watch?v=9AaINsCfZzw) at [ServerSide.Swift 2024](https://www.serversideswift.info/speakers/euan-harris/).
15
21
16
-
## Overview
22
+
## Usage
17
23
18
-
Swift Container Plugin provides a Swift Package Manager command plugin and utilities to make it easy to build container images for servers written in Swift.
24
+
Swift Container Plugin can package any executable product defined in `Package.swift` in a container image and publish it to a container registry.
19
25
20
-
> 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.
26
+
### Build and publish a container image
21
27
22
-
After setting up your project, you can use the plugin to build and publish a container image in one step:
28
+
After adding the plugin to your project, you can build and publish a container image in one step:
23
29
24
30
```
25
31
% swift package --swift-sdk x86_64-swift-linux-musl \
@@ -44,7 +50,9 @@ Build of product 'hello-world' complete! (5.51s)
You can then use a container runtime, such as `podman` to run the image:
53
+
### Run the image
54
+
55
+
You can deploy your service in the cloud, or use a standards-compliant container runtime such as `podman` to run it locally:
48
56
49
57
```
50
58
% podman run -p 8080:8080 registry.example.com/myservice@sha256:a3f75d0932d052dd9d448a1c9040b16f9f2c2ed9190317147dee95a218faf1df
@@ -53,9 +61,13 @@ Trying to pull registry.example.com/myservice@sha256:a3f75d0932d052dd9d448a1c904
53
61
2024-05-26T22:57:50+0000 info HummingBird : [HummingbirdCore] Server started and listening on 0.0.0.0:8080
54
62
```
55
63
56
-
## Getting Started
64
+
## Platforms and requirements
57
65
58
-
Swift Container Plugin requires Swift 6.0 and runs on macOS and Linux. It does not require a local container runtime to be installed in order to build an image.
66
+
* Swift Container Plugin runs on macOS and Linux and requires Swift 6.0 or later.
67
+
* 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.
68
+
* A container runtime is not required to build an image, but one must be available wherever the image is to be run.
69
+
70
+
## Getting Started
59
71
60
72
Learn more about setting up your project in the [ContainerImageBuilder plugin documentation](Sources/ContainerImageBuilderPluginDocumentation/Documentation.docc/ContainerImageBuilderPlugin.md).
0 commit comments