{"id":15910451,"url":"https://github.com/apple/swift-container-plugin","last_synced_at":"2025-04-05T07:01:50.662Z","repository":{"id":257811213,"uuid":"853023965","full_name":"apple/swift-container-plugin","owner":"apple","description":"Swift Package Manager plugin for building container images","archived":false,"fork":false,"pushed_at":"2025-03-25T17:19:10.000Z","size":198,"stargazers_count":164,"open_issues_count":7,"forks_count":10,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-03-29T06:01:55.704Z","etag":null,"topics":["containers","plugin","server-side-swift","swift","swift-package-manager","swift-package-manager-plugin","swiftpm"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apple.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-05T21:04:57.000Z","updated_at":"2025-03-26T00:21:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"3fb2b081-baf6-488f-9828-52f9910dbe5a","html_url":"https://github.com/apple/swift-container-plugin","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"bca5f5149e8003682ab0eaf1d2a4b5021c70ea3a"},"previous_names":["apple/swift-container-plugin"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apple%2Fswift-container-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apple%2Fswift-container-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apple%2Fswift-container-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apple%2Fswift-container-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apple","download_url":"https://codeload.github.com/apple/swift-container-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247299829,"owners_count":20916190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["containers","plugin","server-side-swift","swift","swift-package-manager","swift-package-manager-plugin","swiftpm"],"created_at":"2024-10-06T15:05:26.328Z","updated_at":"2025-04-05T07:01:50.532Z","avatar_url":"https://github.com/apple.png","language":"Swift","readme":"# Swift Container Plugin\n\n[![](https://img.shields.io/badge/docc-read_documentation-blue)](https://swiftpackageindex.com/apple/swift-container-plugin/documentation/containerimagebuilderplugin)\n[![](https://img.shields.io/github/v/release/apple/swift-container-plugin?include_prereleases)](https://github.com/apple/swift-container-plugin/releases)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fapple%2Fswift-container-plugin%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/apple/swift-container-plugin)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fapple%2Fswift-container-plugin%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/apple/swift-container-plugin)\n[![](https://github.com/apple/swift-container-plugin/actions/workflows/main.yml/badge.svg)](https://github.com/apple/swift-container-plugin/actions/workflows/main.yml)\n\nPublish container images using Swift Package Manager.\n\nFind out about Swift Container Plugin and see it in action:\n\n* [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/).\n* [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/).\n\n## Overview\n\nSwift Container Plugin provides a Swift Package Manager command plugin and utilities to make it easy to build container images for servers written in Swift.\n\n\u003e 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.\n\nAfter setting up your project, you can use the plugin to build and publish a container image in one step:\n\n```\n% swift package --swift-sdk x86_64-swift-linux-musl \\\n        build-container-image --repository registry.example.com/myservice\n...\nPlugin ‘ContainerImageBuilder’ wants permission to allow all network connections on all ports.\nStated reason: “This command publishes images to container registries over the network”.\nAllow this plugin to allow all network connections on all ports? (yes/no) yes\n...\nBuilding for debugging...\nBuild of product 'containertool' complete! (4.95s)\n...\nBuild of product 'hello-world' complete! (5.51s)\n...\n[ContainerImageBuilder] Found base image manifest: sha256:7bd643386c6e65cbf52f6e2c480b7a76bce8102b562d33ad2aff7c81b7169a42\n[ContainerImageBuilder] Found base image configuration: sha256:b904a448fde1f8088913d7ad5121c59645b422e6f94c13d922107f027fb7a5b4\n[ContainerImageBuilder] Built application layer\n[ContainerImageBuilder] Uploading application layer\n[ContainerImageBuilder] Layer sha256:dafa2b0c44d2cfb0be6721f079092ddf15dc8bc537fb07fe7c3264c15cb2e8e6: already exists\n[ContainerImageBuilder] Layer sha256:2565d8e736345fc7ba44f9b3900c5c20eda761eee01e01841ac7b494f9db5cf6: already exists\n[ContainerImageBuilder] Layer sha256:2c179bb2e4fe6a3b8445fbeb0ce5351cf24817cb0b068c75a219b12434c54a58: already exists\nregistry.example.com/myservice@sha256:a3f75d0932d052dd9d448a1c9040b16f9f2c2ed9190317147dee95a218faf1df\n```\n\nYou can then use a container runtime, such as `podman` to run the image:\n\n```\n% podman run -p 8080:8080 registry.example.com/myservice@sha256:a3f75d0932d052dd9d448a1c9040b16f9f2c2ed9190317147dee95a218faf1df\nTrying to pull registry.example.com/myservice@sha256:a3f75d0932d052dd9d448a1c9040b16f9f2c2ed9190317147dee95a218faf1df...\n...\n2024-05-26T22:57:50+0000 info HummingBird : [HummingbirdCore] Server started and listening on 0.0.0.0:8080\n```\n\n## Getting Started\n\nSwift 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.\n\nLearn more about setting up your project in the [ContainerImageBuilder plugin documentation](Sources/ContainerImageBuilderPluginDocumentation/Documentation.docc/ContainerImageBuilderPlugin.md).\n\nTake a look at the [Examples](Examples).\n","funding_links":[],"categories":["Swift","HarmonyOS"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapple%2Fswift-container-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapple%2Fswift-container-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapple%2Fswift-container-plugin/lists"}