Skip to content

Latest commit

 

History

History
36 lines (29 loc) · 2.15 KB

Readme for Docker (swift-builder).md

File metadata and controls

36 lines (29 loc) · 2.15 KB

Quick Reference

Dockerfile

Autogenerated by https://github.com/happn-app/swift-docker/blob/master/build_swift_stretch.sh, based on https://github.com/happn-app/swift-docker/blob/master/context_stretch/Dockerfile.builder.base.

Where to File Issues

https://github.com/happn-app/swift-docker/issues

Maintained By

happn

What Is This Image?

This image is an extension of the happn/swift image that allows directly compiling a Swift project for Debian Stretch from its git URL.

How to Use the Image

The entry point of the image is a script that takes a git URL, a set of optional dependencies and build the package at the given URL in /mnt/output. You can retrieve the built product by mounting /mnt/output. Don’t forget to install the swiftlang-libs deb (available in the resulting “products” folder after the build is successful) before running the executable outside the Docker.

Example of use:

docker run -v "$(pwd)/VaporBuild:/mnt/output" --rm -it happn/swift-builder:5.2.1-RELEASE --enable-automatic-resolution https://github.com/vapor/vapor.git=4.0.1 libssl1.0-dev zlib1g-dev pkg-config
#Point by point:
#   docker run                                 Run docker
#   -v "$(pwd)/VaporBuild:/mnt/output"         Mount /mnt/output in ./VaporBuild (in order to retrieve the built products)
#   --rm -it                                   Remove the container after the build is complete, and attach with tty while running
#   happn/swift-builder:5.2.1-RELEASE          The image to run
#   --enable-automatic-resolution              Vapor does not include a Package.resolved file, so we have to enable automatic Package resolution
#   https://github.com/vapor/vapor.git=4.0.1   The URL of the project to build, with the branch/tag/commit to build (here master; optional)
#   libssl1.0-dev zlib1g-dev pkg-config        The dependencies required to build the project

Usage:

usage: ./context_stretch/build_swift_package.sh [--static] [--disable-test-discovery] [--enable-automatic-resolution] git_url[=treeish_object] [build_dependency1, build_dependency2, ...]
note: The static option might not work on Linux.