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

feature: adds docker support #40

Merged
merged 2 commits into from
Apr 18, 2018
Merged

feature: adds docker support #40

merged 2 commits into from
Apr 18, 2018

Conversation

itsjavi
Copy link
Contributor

@itsjavi itsjavi commented Apr 18, 2018

This PR adds the ability to run openapi-diff inside a Docker container.

I had to adjust the pom.xml file because the jar-with-dependencies archive wasn't being generated on mvn package and with the other jar files I was getting the no main manifest attribute, in "xxxx.jar error.

How it works?

  • The Docker build process is separated in two stages, so the final Docker image will be more lightweight and won't need maven inside (just 88.8MB).
  • The first stage generates the 'jar' executable using maven. The Dockerfile auto-detects the version from the pom.xml file in order to use the proper jar.
  • The second stage just exposes it using a simple openjdk container.

Now the missing part is publishing/pushing the image to Docker Hub. I guess you'll want to do that under your own account.
After that the "Build image" part won't be required anymore (as described in the readme changes I added) for the end users.

The nice thing is that once you create the project on Docker hub and configure it, you can have automated builds on every new (tag) release:
https://docs.docker.com/docker-hub/builds/

If you need any help on that just let me know.

@quen2404
Copy link
Member

Thank you very much!!! It was in my todolist, but you was faster than me ! 💯

@quen2404 quen2404 merged commit ad4e292 into OpenAPITools:master Apr 18, 2018
@itsjavi
Copy link
Contributor Author

itsjavi commented Apr 18, 2018

No problem ^^ I am looking forward to use this project with my toolchain on Gitlab CI =)
and that was only possible with Docker support.

@itsjavi itsjavi deleted the feature/docker branch April 18, 2018 17:34
@itsjavi
Copy link
Contributor Author

itsjavi commented May 3, 2018

@quen2404 FYI, turns out that it is not possible to use semver versioning in the docker images, because the only available tag is latest: https://hub.docker.com/r/quen2404/openapi-diff/tags/

@quen2404
Copy link
Member

quen2404 commented May 3, 2018

Ok, i will take a look to push image with tags

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.

2 participants