Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adam-fowler/swift-docker
Integrate docker into swift command line.
https://github.com/adam-fowler/swift-docker
docker spm swift swift-package-manager
Last synced: 4 months ago
JSON representation
Integrate docker into swift command line.
- Host: GitHub
- URL: https://github.com/adam-fowler/swift-docker
- Owner: adam-fowler
- Created: 2021-04-28T10:00:43.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-03T17:53:31.000Z (over 3 years ago)
- Last Synced: 2024-05-02T02:53:16.148Z (10 months ago)
- Topics: docker, spm, swift, swift-package-manager
- Language: Swift
- Homepage:
- Size: 68.4 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# swift-docker
Integrate docker into swift command line.
## Basic Usage
Build a Swift project in docker
```
swift docker build
```
Test a Swift project
```
swift docker test
```
Run a Swift project
```
swift docker run
```
Choose the version of Swift you want to build/test with
```
swift docker test -i swift:5.2
```## Installing
Currently the easiest way to install `swift-docker` is via [mint](https://github.com/yonaskolb/Mint). Once you have mint installed you can install as follows
```
mint install adam-fowler/swift-docker
```## Command line options
| Option | Description |
|---|---|
| -i/--image | Select swift image to use |
| -n/--no-slim | swift-docker will automatically use a slim version of a docker image. This option disables this. |
| -o/--output | Instead of running docker just output Dockerfile |
| -t/--tag | Tag docker output with tag |
| -c/--configuration | Set build configuration (debug or release) |
| --product | Set product to build |
| --target | Set target to build |
| -e/-env | Set environment variable when running docker image |
| -p/-publish | Publish port when running docker image |By adding a `--` everything else after that in the command line will be added as an option to the swift test/build command in the docker file.
```
swift docker test -- --sanitize=thread
```## Dockerfile Template
It is not possible to create a Dockerfile template that supports all projects. Because of this there is an option to edit the template file used to create the Dockerfile. The following will save a local copy of the template file and open it up into a text editor for you to edit.
```
swift docker edit
```