- Notifications
You must be signed in to change notification settings - Fork6
This is a Docker Client written in Swift. It's using the NIO Framework to communicate with the Docker Engine via sockets.
License
alexsteinerde/docker-client-swift
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This is a Docker Client written in Swift. It's using the NIO Framework to communicate with the Docker Engine via sockets.
- List of all images
- List of all containers
- Pull an image
- Create a new container from an image
- Start a container
- Get the stdOut and stdErr output of a container
- Get the docker version information
- Manage the container state
- Create and manage services
- Update services
- List services
- Clean the system (prune containers and images)
import PackageDescriptionletpackage=Package( dependencies:[.package(url:"https://github.com/alexsteinerde/docker-client-swift.git", from:"0.1.0"),], targets:[.target(name:"App", dependencies:["DockerClient"]),...])
To add DockerClientSwift to your existing Xcode project, select File -> Swift Packages -> Add Package Depedancy.Enterhttps://github.com/alexsteinerde/docker-client-swift.git for the URL.
letclient=DockerClient()letimage=try client.images.pullImage(byIdentifier:"hello-world:latest").wait()letcontainer=try client.containers.createContainer(image: image).wait()try container.start(on: client).wait()letoutput=try container.logs(on: client).wait()try client.syncShutdown()print(output)
For further usage examples, please consider looking at the provided test cases. Or have a look at the demo projects in the next section.If you want to read more about this package, feel free to read myblog article about it.
There are two demo applications.
| Project | Link |
|---|---|
| Mac App | https://github.com/alexsteinerde/docker-client-swift-mac-app |
| Vapor App | https://github.com/alexsteinerde/docker-client-vapor-demo |
When using this in production, make sure you secure your application so no others can execute code. Otherwise, the attacker could access your Docker environment and so all of the containers running in it.
This project is released under the MIT license. SeeLICENSE for details.
You can contribute to this project by submitting a detailed issue or by forking this project and sending a pull request. Contributions of any kind are very welcome :)
About
This is a Docker Client written in Swift. It's using the NIO Framework to communicate with the Docker Engine via sockets.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Contributors3
Uh oh!
There was an error while loading.Please reload this page.