Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAllow passing in CLI args directly via Docker #1252
Conversation
This comment has been minimized.
This comment has been minimized.
Hi Ryan, thanks for the input! Since that Dockerfile is specifically for the Code Climate engine, probably can't just change that :) I would like to see a Dockerfile that supports what you are trying to do, but I guess it would have to be in parallel with the Code Climate engine. |
This comment has been minimized.
This comment has been minimized.
Hey presidentbeef, Thanks for the quick feedback. Would it be acceptable to have an alternate Dockerfile, like (I'm bad with names) If so, I'd be happy to make that change an add a corresponding blurb to the README with instructions on how to build with the alternate Dockerfile |
This comment has been minimized.
This comment has been minimized.
Doesn't matter much to me. Would likely make more sense to have the default @noahd1 can you comment? |
This comment has been minimized.
This comment has been minimized.
I'm almost certain that either way will work for us, as long as at the end of the day we can build a Docker image, which is indeed possible regardless of the name of the Dockerfile. @dblandin can you confirm, and also add any insight into naming conventions, if there are any? |
This comment has been minimized.
This comment has been minimized.
Thanks for following up. I can think of two possible options:
After thinking it over I think the first option is the cleanest, since the Dockerfile gives access to the same set of CLI args as the corresponding ruby gem, so I would strongly favor that option. However if there's a bunch of external dependencies that expect the Dockerfile to use the code-climate options then I'm perfectly willing to go with the latter option. Once you guys have consensus just let me know and I'll implement the changes. EDIT: I thought it over a bit more and updated my original proposals, so please take another look at this comment if you'd already read it |
This comment has been minimized.
This comment has been minimized.
Renaming the Code Climate Dockerfile to Our release process looks for a |
This comment has been minimized.
This comment has been minimized.
This is awesome, thank you @noahd1 and @dblandin for jumping in. Let's move That also means the default |
ryankemper
force-pushed the
ryankemper:master
branch
2 times, most recently
from
1830dc8
to
4c5fa60
Aug 22, 2018
This comment has been minimized.
This comment has been minimized.
I've implemented the above. I also went ahead and updated the README, but I wasn't completely sure where to add the new blurbs so let me know if you guys think I should make any further changes. Currently I'm working on making sure the commands I put in the README work - I think instead of |
This comment has been minimized.
This comment has been minimized.
Quick update: It does look like you need to redirect output of the docker container like so:
It makes intuitive sense to me why this is required (I imagine the output file is being written inside the container), but weirdly I thought I had it working with the So, that's one point of difference between the command syntax on the ruby gem vs with the dockerfile. Let me know if you guys think of anything else to add, and also if anything I wrote above looks incorrect. |
This comment has been minimized.
This comment has been minimized.
Update: I had a talented coworker take a look at this PR and they had a few suggestions for the Dockerfile, so I just pushed some commits out to rearrange the order of the layers to avoid having to reinstall dependencies for every code change. Currently those changes were only made to With respect to the Taking a break for a couple hours, then I'll be back to work on getting this wrapped. |
ryankemper
force-pushed the
ryankemper:master
branch
2 times, most recently
from
3eb7089
to
04c84dc
Aug 22, 2018
This comment has been minimized.
This comment has been minimized.
Current status: The new Dockerfile appears to be working great, caches are working as expected. Once you guys have a chance to take a look, we can discuss porting the same changes to There's one last issue - Docker volumes persist on the users' machine after the container is destroyed. While this is expected behavior as far as persistence goes, as far as I can tell the container doesn't actually need persistence for what it's doing. For example, running If I can find a clean way to fix the issue, I'll include it in this branch, otherwise I'll leave it as a future improvement. |
This comment has been minimized.
This comment has been minimized.
Will adding |
This comment has been minimized.
This comment has been minimized.
From reading the docs, it looks like I think we can get away with just not having the [Meta: I probably won't be able to return to this pull request until tomorrow or so] |
This comment has been minimized.
This comment has been minimized.
Update: Manually running
And then run Naturally, this is not ideal. The good news is, removing the docker volume statement entirely from the dockerfile fixes it, and still allows using I just pushed that change. EDIT: I see, you meant add At this point the Dockerfile is either ready to ship or very close to it, so please take a look when you guys get the chance. Thanks again! |
This comment has been minimized.
This comment has been minimized.
This seems to be working great for me. Will merge soon unless anyone objects. |
This comment has been minimized.
This comment has been minimized.
Awesome. I'll quickly make the last remaining changes:
Lastly, I'll rebase if necessary - haven't checked if anything's been merged to master since this PR has been opened |
ryankemper
added some commits
Aug 21, 2018
ryankemper
added some commits
Aug 24, 2018
ryankemper
force-pushed the
ryankemper:master
branch
from
c589b6a
to
eb9d173
Aug 27, 2018
This comment has been minimized.
This comment has been minimized.
Added the changes, rebased to upstream, and force pushed. If the CI looks good, my recommendation is to |
jadametz
approved these changes
Aug 27, 2018
jadametz left a comment
This is going to be a great addition to our CI pipeline very soon |
@@ -1,15 +1,25 @@ | |||
FROM ruby:2.4-alpine | |||
MAINTAINER Justin Collins | |||
LABEL maintainer="Justin Collins" |
This comment has been minimized.
This comment has been minimized.
jadametz
Aug 27, 2018
@presidentbeef not sure if you wanna give this level of detail, but normally the Maintainer would come with some form of a contact method, e.g. email address.
ryankemper commentedAug 21, 2018
•
edited
I found that while brakeman works great when gem installed locally, the Dockerbuild file is set up such that you can't pass in arbitrary arguments to brakeman. Regardless of input, it simply supplies the default output as JSON.
This branch changes
CMD
->ENTRYPOINT
so that the user doesn't have to supply the path to the brakeman binary (which they shouldn't have to know about). Furthermore, it links directly to thebrakeman
binary rather thancodeclimate-brakeman
, sincecodeclimate-brakeman
does not seem to respect command line arguments.Now you can simply build the docker image and run it just like you would run brakeman locally, e.g. a command like the following:
docker run -v "$(pwd)":/code brakeman -o brakeman_docker_w3.html -q -w3
Thanks