Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker support #163

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Docker support #163

wants to merge 6 commits into from

Conversation

Kastet
Copy link
Contributor

@Kastet Kastet commented May 14, 2019

Solves #160

Changes:

  • adds Dockerfile
  • updates README with instructions to use a pre-built image

@mithun
Copy link

mithun commented May 15, 2019

  • Can the Dockerfile be split into multiple stages so that the published image does not necessarily contain the sources and build directory?
  • Ideally, the docker image should be published to a Docker Hub repository owned by @yonaskolb. Otherwise, users may not trust it

I have an example of a multi-stage Dockerfile here: https://github.com/mithun/swaggen-docker/blob/master/Dockerfile

@Kastet
Copy link
Contributor Author

Kastet commented May 21, 2019

Thanks for this example @mithun, good suggestion!

@@ -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.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be referencing airtasker?

Copy link

@mithun mithun Jul 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't. As a user of the docker image, I will not trust it unless it is published by @yonaskolb , which is why I'm building my own

Copy link
Contributor

@mackoj mackoj Oct 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

I do think that having a first party Docker image is crucial for (CI use for exemple).
So I build did my own Docker image by forking @mithun(great) Docker image.

I have made a couple of tweaks from @mithun(great) Docker image:

  • updating it to the latest version of Swift
  • making it generate image with Swift slim image - 4.2.0(467.93 MB) -> 4.2.0-slim(77.05 MB) 83% smaller 😱
  • add a bunch of variable to make it easy to generate images for various tag of my fork of SwagGen

https://hub.docker.com/r/hawkci/swaggen

Copy link
Contributor

@mackoj mackoj Mar 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a few months of working with Swaggen in a Docker container I do prefer this workflow. Because it guarantees that it is working the same way as our CI is working. With one script anyone(back/front end dev) in the team can generate a custom version of the library. It's easier to maintain and update. FWIW I do update my Swaggen image for every new Swift build.
Last update was this morning with Swift 5.1.5 it's pretty easy to do.

@mackoj
Copy link
Contributor

mackoj commented Oct 8, 2019

@mithun Can your https://github.com/mithun/swaggen-docker take all the same parameter as the official binary ?

@mithun
Copy link

mithun commented Oct 8, 2019

@mithun Can your https://github.com/mithun/swaggen-docker take all the same parameter as the official binary ?

Yes

@mackoj mackoj mentioned this pull request Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants