Fork me on GitHub

Alex Rupérez

Published: 05 Mar 15:12
I starred iainsmith/swift-docker at GitHub.
Test your swift packages with one command `swift docker test`
View on GitHub



Test your swift package is Linux compatible using one command. swift docker test

Install swift-docker

brew tap iainsmith/formulae
brew install swift-docker
or from source
> git clone
> cd swift-docker
> swift build -c release -Xswiftc -static-stdlib
# copy the binary to somewhere in your path. 
> cp ./.build/x86_64-apple-macosx10.10/release/swift-docker ~/bin

And install docker if you don't have it already
  • Download the Docker Mac App.
  • Alternatively install via homebrew brew install docker


Run the Tests

# Against the latest version of swift
swift docker test

# Against a swift version
swift docker test --swift 4.0

# Using a specific image
swift docker test --image ibmcom/swift-ubuntu:4.1

# Run tests and save dockerfile
swift docker test --image ibmcom/swift-ubuntu:4.1 --write-dockerfile  

Save the default dockerfile to ./Dockerfile

swift docker write-dockerfile

Cleanup docker images generated by swift-docker

swift docker cleanup


swift-docker is built on top of


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