diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..08e542552 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM swift:5.0.1 + +WORKDIR /SwagGen +COPY . /SwagGen +RUN make install diff --git a/README.md b/README.md index e260ba28d..f0e673613 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,16 @@ import SwagGenKit import Swagger ``` +## Docker + +`airtasker/swaggen` image acts as a standalone executable. It can be used as an alternative to installing via homebrew, or for developers who are unable to install Xcode. + +To generate code with this image, you'll need to mount a local location as a volume. If you want to pass Swagger spec as a file it needs to be inside the mounted volume. Custom templates and the output destination should also be inside the mounted volume. + +```sh +$ docker run --rm -v local_dir:/workdir airtasker/swaggen swaggen generate /workdir/api.yml --destination /workdir/generated --template Templates/Swift/template.yml +``` + ## Usage Use `--help` to see usage information