All Projects → iainsmith → Swift Docker

iainsmith / Swift Docker

Licence: mit
Build & test your swift packages using docker - `swift docker test`

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Swift Docker

EggSeed
Command Line Tool for Starting Your Swift Packages with Continuous Integration
Stars: ✭ 21 (-88.27%)
Mutual labels:  swift-package-manager, swiftpm
ConsoleUI
Rasterize SwiftUI views to images from macOS terminal
Stars: ✭ 52 (-70.95%)
Mutual labels:  swift-package-manager, swiftpm
Swipycell
Easy to use UITableViewCell implementing swiping to trigger actions.
Stars: ✭ 230 (+28.49%)
Mutual labels:  swift-package-manager, swiftpm
PackageBuilder
PackageBuilder builds a simple command-line structure by SwiftPM.
Stars: ✭ 27 (-84.92%)
Mutual labels:  swift-package-manager, swiftpm
Rock
With Rock you can easily install CLIs built with Swift Package Manager. Prefer vknabel/Archery and yonaskolb/Mint instead
Stars: ✭ 13 (-92.74%)
Mutual labels:  swift-package-manager, swiftpm
Scenekit Scnline
Draw a tube or thick line in SceneKit
Stars: ✭ 49 (-72.63%)
Mutual labels:  swift-package-manager, swiftpm
tracelog
TraceLog is a highly configurable, flexible, portable, and simple to use debug logging system for Swift and Objective-C applications running on Linux, macOS, iOS, watchOS, and tvOS.
Stars: ✭ 52 (-70.95%)
Mutual labels:  swift-package-manager, swiftpm
vintage
[UNMAINTED] command-line tool to check for outdated Swift Package Manager dependencies
Stars: ✭ 33 (-81.56%)
Mutual labels:  swift-package-manager, swiftpm
Realityui
A Swift Package for creating familiar UI Elements and animations in a RealityKit rendered Augmented Reality or Virtual Reality scene.
Stars: ✭ 275 (+53.63%)
Mutual labels:  swift-package-manager, swiftpm
Scenekit Bezier Animations
Create animations over Bezier curves of any number of points
Stars: ✭ 35 (-80.45%)
Mutual labels:  swift-package-manager, swiftpm
Dikit
Dependency Injection Framework for Swift, inspired by KOIN.
Stars: ✭ 77 (-56.98%)
Mutual labels:  swift-package-manager, swiftpm
Umbrella android
Open source Android, iOS and Web app for learning about and managing digital and physical security. From how to send a secure message to dealing with a kidnap. Umbrella has best practice guides in over 40 topics in multiple languages. Used daily by people working in high risk countries - journalists, activists, diplomats, business travelers etc.
Stars: ✭ 171 (-4.47%)
Mutual labels:  opensource
Goupaz.com
Community driven open source accelerator
Stars: ✭ 163 (-8.94%)
Mutual labels:  opensource
Kvkcalendar
A most fully customization calendar and timeline library for iOS 📅
Stars: ✭ 160 (-10.61%)
Mutual labels:  swift-package-manager
Oscp bible
This is a collection of resources, scripts, bookmarks, writeups, notes, cheatsheets that will help you in OSCP Preparation as well as for general pentesting and learning. If you feel like you can contribute in it. Please do that, I'll appreciate you.
Stars: ✭ 160 (-10.61%)
Mutual labels:  opensource
Data Structures And Algorithms In Cpp
This repository is in development phase and will soon provide you with c++ code of various data structures and algorithms
Stars: ✭ 176 (-1.68%)
Mutual labels:  opensource
Langserver Swift
A Swift implementation of the open Language Server Protocol.
Stars: ✭ 171 (-4.47%)
Mutual labels:  swift-package-manager
Awesome Opensource Unity
a list of curated opensource Unity packages for future proof Game Developers
Stars: ✭ 161 (-10.06%)
Mutual labels:  opensource
Tree Gateway
This is a full featured and free API Gateway
Stars: ✭ 160 (-10.61%)
Mutual labels:  opensource
Clendar
Clendar - universal calendar app. Written in SwiftUI. Available on App Store
Stars: ✭ 153 (-14.53%)
Mutual labels:  swift-package-manager

swift-docker

A command line tool for building, testing & running your swift package in a docker container.

Quick start for macOS

brew install iainsmith/formulae/swift-docker # Install swift docker
git clone https://github.com/jpsim/Yams.git # Clone an example package
cd Yams && swift test # Run the tests on your machine
swift docker test # Run the tests in a container
swift docker test --swift 5.1 # Check if the tests pass on swift 5.1
swift docker write-dockerfile # Write a ./Dockerfile to the repo

Features

  • [x] Test swift packages in one command swift docker test
  • [x] Use custom images - swift docker test --image vapor/swift:latest
  • [x] swift docker build/test/run commands mirror swift build/test/run
  • [x] Run your vapor application in a container - swift docker vapor
  • [x] Cached builds using docker volumes
  • [x] Use a mix of docker volumes & bind mounts for fast, small builds.
  • [x] Uses the swift docker image that matches the Package.swift manifest.
  • [x] Quickly free up space - swift docker cleanup
  • [x] Create a dockerfile for your project
  • [x] Quickly print a command to run the swift repl in the container - swift docker repl
  • [ ] Create a .dockerignore file to avoid adding .git directory to the image
  • [ ] Support multistage slim builds
  • [ ] Log output to a file
  • [ ] cmake build for running on Windows

Install swift-docker

Install with Homebrew

brew install iainsmith/formulae/swift-docker
Install from source
> git clone https://github.com/iainsmith/swift-docker-cli.git
> cd swift-docker
> swift build -c release --disable-sandbox
# copy the binary to somewhere in your path.
> cp ./.build/release/swift-docker ~/bin
And install docker if you don't have it already
  • Download the Docker Mac App.
  • Or alternatively install via homebrew brew cask install docker

Usage

OVERVIEW: A simple workflow for building & testing swift packages with docker

Run swift docker <subcommand> --help for subcommand details
Reference - Offical docker images: https://hub.docker.com/_/swift

Examples:

swift docker test
swift docker build -- --configuration release
swift docker run your-executable --flag1
swift docker vapor

USAGE: swift-docker <subcommand>

OPTIONS:
-h, --help              Show help information.

SUBCOMMANDS:
build                   Build your swift package in a docker container.
test                    Test your swift package in a docker container.
run                     Run your swift package in a docker container.
vapor                   Run your vapor web application in a container.
build-image             Build a docker image for your swift package.
repl                    print the command to run the swift repl in a container.
cleanup                 Remove temporary docker images.
write-dockerfile        Write a dockerfile to disk.

Vapor

Run swift docker vapor to run your vapor application in a docker container. This is significantly faster than workflows that require you to build a docker image as we bind the local directory into the container, and cache the build folder.

  • You can pass custom arguments to your application by running swift docker vapor -- arg1 --flag1.
  • Currently the environment is set to production & the port is set to 8080.
  • The default docker image is swift:latest. You can use a custom image with swift docker vapor --image vapor/swift:latest

Docker labels

Each docker image created by swift-docker is tagged with two labels.

LABEL com.swiftdockercli.action="test/build"
LABEL com.swiftdockercli.folder="your-project-name"

Running docker volume ls --filter label=com.swiftdockercli.action=test will list volumes created by swift-docker test.

Contributing

If you have suggestions for new commands, features or bug fixes. Please raise an issue or open a PR.

If you find this tool useful in your workflow let me know on twitter @_iains

Credits

swift-docker is built on top of

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].