-
Notifications
You must be signed in to change notification settings - Fork 739
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow passing in CLI args directly via Docker (#1252)
Add new Dockerfile to run Brakeman via Docker
- Loading branch information
1 parent
f8bbd43
commit ac689aa
Showing
4 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# ignore .git and .cache folders | ||
.git | ||
.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,25 @@ | ||
FROM ruby:2.4-alpine | ||
MAINTAINER Justin Collins | ||
LABEL maintainer="Justin Collins" | ||
|
||
WORKDIR /usr/src/app | ||
COPY . /usr/src/app | ||
|
||
# Create user named app with uid=9000, give it ownership of /usr/src/app | ||
RUN adduser -u 9000 -D app && \ | ||
chown -R app:app /usr/src/app | ||
USER app | ||
|
||
# Copy our Gemfile (and related files) *without* copying our actual source code yet | ||
COPY Gemfile* *.gemspec gem_common.rb ./ | ||
# Copy lib/brakeman/version.rb so that bundle install works | ||
COPY lib/brakeman/version.rb ./lib/brakeman/ | ||
|
||
# Install the necessary gems | ||
RUN bundle install --jobs 4 --without "development test" | ||
|
||
VOLUME /code | ||
# Copy in the latest Brakeman source code as the final stage | ||
COPY . /usr/src/app | ||
|
||
# Default to looking for source in /code | ||
WORKDIR /code | ||
|
||
CMD ["/usr/src/app/bin/codeclimate-brakeman"] | ||
ENTRYPOINT ["/usr/src/app/bin/brakeman"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM ruby:2.4-alpine | ||
LABEL maintainer="Justin Collins" | ||
|
||
WORKDIR /usr/src/app | ||
|
||
# Create user named app with uid=9000, give it ownership of /usr/src/app | ||
RUN adduser -u 9000 -D app && \ | ||
chown -R app:app /usr/src/app | ||
USER app | ||
|
||
# Copy our Gemfile (and related files) *without* copying our actual source code yet | ||
COPY Gemfile* *.gemspec gem_common.rb ./ | ||
# Copy lib/brakeman/version.rb so that bundle install works | ||
COPY lib/brakeman/version.rb ./lib/brakeman/ | ||
|
||
# Install the necessary gems | ||
RUN bundle install --jobs 4 --without "development test" | ||
|
||
# Copy in the latest Brakeman source code as the final stage | ||
COPY . /usr/src/app | ||
|
||
# Default to looking for source in /code | ||
WORKDIR /code | ||
|
||
CMD ["/usr/src/app/bin/codeclimate-brakeman"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters