Files
metasploit-gs/Dockerfile
T

64 lines
1.8 KiB
Docker
Raw Normal View History

2018-03-30 12:47:19 +02:00
FROM ruby:2.5.1-alpine3.7
2017-11-28 21:35:20 +01:00
LABEL maintainer="Rapid7"
2017-04-22 02:10:00 +02:00
ARG BUNDLER_ARGS="--jobs=8 --without development test coverage"
ENV APP_HOME /usr/src/metasploit-framework/
2017-05-17 18:18:58 +03:00
ENV NMAP_PRIVILEGED=""
2017-11-28 21:35:20 +01:00
ENV BUNDLE_IGNORE_MESSAGES="true"
WORKDIR $APP_HOME
2017-11-28 21:35:20 +01:00
COPY Gemfile* metasploit-framework.gemspec Rakefile $APP_HOME
COPY lib/metasploit/framework/version.rb $APP_HOME/lib/metasploit/framework/version.rb
COPY lib/metasploit/framework/rails_version_constraint.rb $APP_HOME/lib/metasploit/framework/rails_version_constraint.rb
COPY lib/msf/util/helper.rb $APP_HOME/lib/msf/util/helper.rb
RUN apk update && \
2017-04-22 02:10:00 +02:00
apk add \
2018-02-17 20:12:35 +01:00
bash \
2017-04-22 02:10:00 +02:00
sqlite-libs \
nmap \
2017-05-18 12:54:53 +03:00
nmap-scripts \
nmap-nselibs \
2017-04-22 02:10:00 +02:00
postgresql-libs \
2018-01-28 02:47:09 -06:00
python \
python3 \
2017-04-22 02:10:00 +02:00
ncurses \
2017-04-27 10:36:56 +02:00
libcap \
2018-02-17 20:12:35 +01:00
su-exec \
2017-04-22 02:10:00 +02:00
&& apk add --virtual .ruby-builddeps \
autoconf \
bison \
build-base \
ruby-dev \
2018-01-28 02:47:09 -06:00
libressl-dev \
2017-04-22 02:10:00 +02:00
readline-dev \
sqlite-dev \
postgresql-dev \
libpcap-dev \
libxml2-dev \
libxslt-dev \
yaml-dev \
zlib-dev \
ncurses-dev \
2017-07-17 09:41:47 -05:00
git \
2017-04-22 02:10:00 +02:00
&& echo "gem: --no-ri --no-rdoc" > /etc/gemrc \
2017-11-28 21:35:20 +01:00
&& gem update --system \
2017-08-09 15:34:23 +02:00
&& gem install bundler \
2017-04-22 02:10:00 +02:00
&& bundle install --system $BUNDLER_ARGS \
&& apk del .ruby-builddeps \
&& rm -rf /var/cache/apk/*
2017-04-27 10:55:03 +02:00
RUN /usr/sbin/setcap cap_net_raw,cap_net_bind_service=+eip $(which ruby)
2017-11-28 21:35:20 +01:00
RUN /usr/sbin/setcap cap_net_raw,cap_net_bind_service=+eip $(which nmap)
2017-04-27 10:55:03 +02:00
ADD ./ $APP_HOME
2017-04-27 10:36:56 +02:00
2018-02-17 20:12:35 +01:00
# we need this entrypoint to dynamically create a user
# matching the hosts UID and GID so we can mount something
# from the users home directory. If the IDs don't match
# it results in access denied errors. Once docker has
# a solution for this we can revert it back to normal
ENTRYPOINT ["docker/entrypoint.sh"]
CMD ["./msfconsole", "-r", "docker/msfconsole.rc"]