1N3 / Sn1per

Attack Surface Management Platform
https://sn1persecurity.com
Other
8.06k stars 1.85k forks source link

Docker build fails #274

Closed arthurk closed 4 years ago

arthurk commented 4 years ago

I'm following the instructions from the readme to build the dockerfile:

curl -O https://raw.githubusercontent.com/1N3/Sn1per/master/Dockerfile
docker build -t sn1per .

after some time it fails:

 => [4/6] RUN apt-get install -y metasploit-framework                                                                    627.6s 
 => ERROR [5/6] RUN sed -i 's/systemctl status ${PG_SERVICE}/service ${PG_SERVICE} status/g' /usr/bin/msfdb &&     servic  5.0s 
------                                                                                                                          
 > [5/6] RUN sed -i 's/systemctl status ${PG_SERVICE}/service ${PG_SERVICE} status/g' /usr/bin/msfdb &&     service postgresql start &&     msfdb reinit:                                                                                                       
#7 0.345 Starting PostgreSQL 12 database server: main.                                                                          
#7 2.676 [i] Database already started                                                                                           
#7 2.965 [+] Deleting configuration file /usr/share/metasploit-framework/config/database.yml                                    
#7 3.024 [+] Stopping database
#7 3.024 /usr/bin/msfdb: line 51: systemctl: command not found
#7 3.085 [i] Database already started
#7 3.163 [+] Creating database user 'msf'
#7 3.373 [+] Creating databases 'msf'
#7 3.909 [+] Creating databases 'msf_test'
#7 4.331 [+] Creating configuration file '/usr/share/metasploit-framework/config/database.yml'
#7 4.334 [+] Creating initial database schema
#7 4.917 /usr/share/rubygems-integration/all/gems/bundler-2.1.4/lib/bundler/runtime.rb:312:in `check_for_activated_spec!': You have already activated reline 0.1.3, but your Gemfile requires reline 0.1.4. Since reline is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports reline as a default gem. (Gem::LoadError)
#7 4.917    from /usr/share/rubygems-integration/all/gems/bundler-2.1.4/lib/bundler/runtime.rb:31:in `block in setup'
#7 4.917    from /usr/share/rubygems-integration/all/gems/bundler-2.1.4/lib/bundler/spec_set.rb:147:in `each'
#7 4.917    from /usr/share/rubygems-integration/all/gems/bundler-2.1.4/lib/bundler/spec_set.rb:147:in `each'
#7 4.917    from /usr/share/rubygems-integration/all/gems/bundler-2.1.4/lib/bundler/runtime.rb:26:in `map'
#7 4.917    from /usr/share/rubygems-integration/all/gems/bundler-2.1.4/lib/bundler/runtime.rb:26:in `setup'
#7 4.917    from /usr/share/rubygems-integration/all/gems/bundler-2.1.4/lib/bundler.rb:149:in `setup'
#7 4.917    from /usr/share/rubygems-integration/all/gems/bundler-2.1.4/lib/bundler/setup.rb:20:in `block in <top (required)>'
#7 4.917    from /usr/share/rubygems-integration/all/gems/bundler-2.1.4/lib/bundler/ui/shell.rb:136:in `with_level'
#7 4.917    from /usr/share/rubygems-integration/all/gems/bundler-2.1.4/lib/bundler/ui/shell.rb:88:in `silence'
#7 4.917    from /usr/share/rubygems-integration/all/gems/bundler-2.1.4/lib/bundler/setup.rb:20:in `<top (required)>'
#7 4.917    from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
#7 4.917    from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
------
failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed running [/bin/sh -c sed -i 's/systemctl status ${PG_SERVICE}/service ${PG_SERVICE} status/g' /usr/bin/msfdb &&     service postgresql start &&     msfdb reinit]: runc did not terminate sucessfully
1N3 commented 4 years ago

Thanks for the heads up. I just checked in a fix for this on the latest github repo which should hopefully resolve this. It looks like some packages were removed from the default image which broke other dependencies required by Sn1per. I would try rebuilding the image again to see if that helps.