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

🐳 Init dockerfile #61

Merged
merged 3 commits into from Oct 31, 2018
Merged

🐳 Init dockerfile #61

merged 3 commits into from Oct 31, 2018

Conversation

lhauspie
Copy link
Contributor

@lhauspie lhauspie commented Oct 28, 2018

I had 2 options to write this Dockerfile:

  1. Build the gitmoji-changelog "binary" from source
  2. Install the binary from npm registry

Even if the second option offers a lighter Docker Image (102MB) compared to the first one (263MB), I chose the first one because I think we cannot build a Docker Image based on "binary" from "https://registry.npmjs.org/gitmoji-changelog" until it is available (but I maybe wrong, just tell me).

So, this Dockerfile:

  • copy sources of gitmoji-changelog
  • then build them by using yarn
  • and define the entrypoint to /usr/src/gitmoji-changelog/node_modules/.bin/gitmoji-changelog

Usage

docker run --rm -v $(pwd):/usr/src/app gitmoji-changelog where $(pwd) is the folder of the project you want to generate the CHANGELOG.md.

All Commands, Positionals and Options are available with docker run command.
For instance, docker run --rm -v $(pwd):$(pwd) -w $(pwd) gitmoji-changelog:1.0.0 --help outputs:

Usage: gitmoji-changelog <command> [options]

Commands:
  gitmoji-changelog [release]         Generate changelog               [default]
  gitmoji-changelog init              Initialize changelog from tags
  gitmoji-changelog update [release]  Update changelog with a new version

Positionals:
  release  Next version (from-package, next)           [default: "from-package"]

Options:
  --version  Show version number                                       [boolean]
  --format   changelog format (markdown, json)             [default: "markdown"]
  --output   output changelog file
  --help     Show help                                                 [boolean]

For more information visit:
https://github.com/frinyvonnick/gitmoji-changelog#readme

Closes #29

Dockerfile Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
@fabienjuif
Copy link
Collaborator

Thank you @lhauspie ♥️

You make a good choice I guess.
But the option 2 could work on a CI that publish the package THEN build the docker image.

But let it this way:

  • Maybe the --production installation will remove some MB
  • We should look at CLI size in a dedicated PR, when gitmoji-changelog will be more stable.

Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
@bpetetot
Copy link
Collaborator

bpetetot commented Oct 30, 2018

👍 Great job!
@lhauspie @fabienjuif @frinyvonnick
Maybe we should also add "Use with Docker" in the README.md file

@fabienjuif
Copy link
Collaborator

fabienjuif commented Oct 30, 2018

I agree with @bpetetot and want to add this:
At the end, I was thinking to add a travis line to automatically build and publish this image on @frinyvonnick account

It should be an other PR/Issue

@lhauspie
Copy link
Contributor Author

I agree too with @bpetetot, but I didn't update the README.md because the docker image was not pushed on the docker hub.

I think, like @fabienjuif, it's part of another issue about "Include the docker image build and publish in travis".

Copy link
Collaborator

@fabienjuif fabienjuif left a comment

Choose a reason for hiding this comment

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

👌

@frinyvonnick
Copy link
Owner

frinyvonnick commented Oct 30, 2018

So I merge it @bpetetot accordingly to previous comments ?

@fabienjuif
Copy link
Collaborator

Related issue #64

Dockerfile Outdated Show resolved Hide resolved
Co-Authored-By: lhauspie <logan.hauspie.pro@gmail.com>
Copy link
Owner

@frinyvonnick frinyvonnick left a comment

Choose a reason for hiding this comment

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

Nice work @lhauspie 👍

@frinyvonnick frinyvonnick merged commit afa7021 into frinyvonnick:master Oct 31, 2018
@lhauspie
Copy link
Contributor Author

Thank's.
Glad to help 😉

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

6 participants