Mirror of metasploit
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Dockerfile 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. FROM ruby:2.4.3-alpine3.7
  2. LABEL maintainer="Rapid7"
  3. ARG BUNDLER_ARGS="--jobs=8 --without development test coverage"
  4. ENV APP_HOME /usr/src/metasploit-framework/
  5. ENV NMAP_PRIVILEGED=""
  6. ENV BUNDLE_IGNORE_MESSAGES="true"
  7. WORKDIR $APP_HOME
  8. COPY Gemfile* metasploit-framework.gemspec Rakefile $APP_HOME
  9. COPY lib/metasploit/framework/version.rb $APP_HOME/lib/metasploit/framework/version.rb
  10. COPY lib/metasploit/framework/rails_version_constraint.rb $APP_HOME/lib/metasploit/framework/rails_version_constraint.rb
  11. COPY lib/msf/util/helper.rb $APP_HOME/lib/msf/util/helper.rb
  12. RUN apk update && \
  13. apk add \
  14. bash \
  15. sqlite-libs \
  16. nmap \
  17. nmap-scripts \
  18. nmap-nselibs \
  19. postgresql-libs \
  20. python \
  21. python3 \
  22. ncurses \
  23. libcap \
  24. su-exec \
  25. && apk add --virtual .ruby-builddeps \
  26. autoconf \
  27. bison \
  28. build-base \
  29. ruby-dev \
  30. libressl-dev \
  31. readline-dev \
  32. sqlite-dev \
  33. postgresql-dev \
  34. libpcap-dev \
  35. libxml2-dev \
  36. libxslt-dev \
  37. yaml-dev \
  38. zlib-dev \
  39. ncurses-dev \
  40. git \
  41. && echo "gem: --no-ri --no-rdoc" > /etc/gemrc \
  42. && gem update --system \
  43. && gem install bundler \
  44. && bundle install --system $BUNDLER_ARGS \
  45. && apk del .ruby-builddeps \
  46. && rm -rf /var/cache/apk/*
  47. RUN /usr/sbin/setcap cap_net_raw,cap_net_bind_service=+eip $(which ruby)
  48. RUN /usr/sbin/setcap cap_net_raw,cap_net_bind_service=+eip $(which nmap)
  49. ADD ./ $APP_HOME
  50. # we need this entrypoint to dynamically create a user
  51. # matching the hosts UID and GID so we can mount something
  52. # from the users home directory. If the IDs don't match
  53. # it results in access denied errors. Once docker has
  54. # a solution for this we can revert it back to normal
  55. ENTRYPOINT ["docker/entrypoint.sh"]
  56. CMD ["./msfconsole", "-r", "docker/msfconsole.rc"]