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

Using ENTRYPOINT exec form in Dockerfile #88

Merged
merged 3 commits into from
Aug 23, 2020
Merged

Conversation

warhod
Copy link
Contributor

@warhod warhod commented Aug 18, 2020

Fixes

  • Using ENTRYPOINT exec form in Dockerfile

Proposed Changes

  • With this change, I can now add flags directly to the end like this: docker run -u "$(id -u):$(id -g)" -w=/tmp -v "$PWD":/tmp nvuillam/npm-groovy-lint --verbose --noserver --no-insight --failon error. Whereas before, I'd have to override your ENTRYPOINT with --entrypoint=npm-groovy-lint which is not as clean.
  • The default CMD is --help, so that if the user doesn't specify the CMD the help menu will be displayed. For most intent and purposes we expect the user to customize runtime by passing in their desired parameter so I feel this is a more sane default.

Dockerfile's ENTRYPOINT exec form is the preferred form over shell form.  This allows user of this docker image to specify flags as CMD.

With this change, I can now add flags directly to the end like this: `docker run -u "$(id -u):$(id -g)" -w=/tmp -v "$PWD":/tmp nvuillam/npm-groovy-lint --verbose --noserver --no-insight --failon error`.  Whereas before, I'd have to override your ENTRYPOINT with `--entrypoint=npm-groovy-lint` which is not as clean.
@codecov-commenter
Copy link

codecov-commenter commented Aug 18, 2020

Codecov Report

Merging #88 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #88   +/-   ##
=======================================
  Coverage   93.71%   93.71%           
=======================================
  Files          72       72           
  Lines        1798     1798           
=======================================
  Hits         1685     1685           
  Misses        113      113           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 65688bf...92ede24. Read the comment docs.

@nvuillam
Copy link
Owner

I agree that it would be nice to be able to send arguments directly in docker run :)

Questions:

  • ascending compatibility: what happens to existing docker image integrations ? Won't they just display npm-groovy-lint help, whereas today they perform a linting using default option values ?

  • please could you also update the docker part in the README documentation ?

@davegallant , as you built the v1 of the dockerfile, maybe you have comments too ?

@nvuillam nvuillam self-requested a review August 18, 2020 08:18
@nvuillam nvuillam added enhancement New feature or request good first issue Good for newcomers labels Aug 18, 2020
Copy link
Contributor

@davegallant davegallant left a comment

Choose a reason for hiding this comment

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

lgtm, but the docs should be updated.

@@ -10,4 +10,5 @@ RUN apk add --update \

RUN npm i -g

ENTRYPOINT "npm-groovy-lint"
ENTRYPOINT ["npm-groovy-lint"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Dockerfile Outdated
@@ -10,4 +10,5 @@ RUN apk add --update \

RUN npm i -g

ENTRYPOINT "npm-groovy-lint"
ENTRYPOINT ["npm-groovy-lint"]
CMD ["--help"]
Copy link
Contributor

Choose a reason for hiding this comment

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

This differs from running npm-groovy-lint.
Should the default behaviour be changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. In order to avoid breaking the default behavior and potentially angering hordes of users who don't specify their docker tags, we can revert this. In my testing we can still do docker run -u "$(id -u):$(id -g)" -w=/tmp -v "$PWD":/tmp nvuillam/npm-groovy-lint --help to achieve the same result as long as the exec form is used.

@warhod
Copy link
Contributor Author

warhod commented Aug 19, 2020

Updated per feedback and should be ready to merge?

@nvuillam
Copy link
Owner

Sorry i'm in vacation, i'll validate & generate version asap :)

@nvuillam nvuillam merged commit fb600f0 into nvuillam:master Aug 23, 2020
@warhod warhod deleted the patch-1 branch September 2, 2020 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants