Opened 12 months ago

Last modified 9 months ago

#27343 needs_revision enhancement

Dockerfile for sbws basic install

Reported by: gabe Owned by:
Priority: Medium Milestone: sbws: unspecified
Component: Core Tor/sbws Version:
Severity: Normal Keywords:
Cc: pastly, juga, teor Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

FROM debian

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get -qy install python3-pip git &&  \
        apt-get clean && \
        rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN useradd --shell /bin/bash -u 1000 -m  test

USER test

RUN git clone https://git.torproject.org/stem.git /home/test/stem
RUN git clone https://github.com/pastly/simple-bw-scanner.git /home/test/simple-bw-scanner

USER root

RUN pip3 install /home/test/stem
RUN pip3 install /home/test/simple-bw-scanner

USER test

CMD /usr/local/bin/sbws scanner

Just a basic Dockerfile to get sbws installed inside Docker. Note that it needs to be adapted a little bit, as it lacks a config file... Whenever I figure out the config file aspect, I can get that included easily.

Child Tickets

Change History (10)

comment:1 Changed 12 months ago by teor

Status: newneeds_revision

Thanks for this patch!

I think sbws also requires an installed tor client.

comment:2 Changed 12 months ago by gabe

Simple build steps:

  1. install docker, ensure it works.
  1. Create a directory for your build file, in my case ~/containers/debian-sbws
  1. cd ~/containers/debian-sbws
  1. sudo docker build -t sbws .
  1. run the container with:
sudo docker run -it --rm sbws 
{{{

Note that this is just a test sample... And that it's broken due to no config.


{{{
grocha@mordor:~/containers/debian-sbws$ sudo docker run -it --rm sbws 
Traceback (most recent call last):
  File "/usr/lib/python3.5/logging/handlers.py", line 823, in _connect_unixsocket
    self.socket.connect(address)
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/sbws", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.5/dist-packages/sbws/sbws.py", line 53, in main
    configure_logging(args, conf)
  File "/usr/local/lib/python3.5/dist-packages/sbws/util/config.py", line 160, in configure_logging
    logging.config.fileConfig(fd.name)
  File "/usr/lib/python3.5/logging/config.py", line 84, in fileConfig
    handlers = _install_handlers(cp, formatters)
  File "/usr/lib/python3.5/logging/config.py", line 148, in _install_handlers
    h = klass(*args)
  File "/usr/lib/python3.5/logging/handlers.py", line 806, in __init__
    self._connect_unixsocket(address)
  File "/usr/lib/python3.5/logging/handlers.py", line 834, in _connect_unixsocket
    self.socket.connect(address)
FileNotFoundError: [Errno 2] No such file or directory

}}}
}}}

comment:3 in reply to:  1 Changed 12 months ago by gabe

Replying to teor:

Thanks for this patch!

I think sbws also requires an installed tor client.

Hi there, I am sure it does. I was just working with arma on this and figured I'd create some tickets to follow up the discussion he and I had.

comment:4 Changed 12 months ago by pastly

Right I think you just need to install tor in addition to python3 and git. Sbws will launch Tor for itself.

I think getting https://github.com/pastly/simple-bw-scanner/pull/244 (#27342) merged will allow you to launch sbws.

A successful first launch of sbws looks like this

(venv-test) matt@spacecow:~/src/simple-bw-scanner$ sbws scanner
[2018-08-27 20:17:06,592] [sbws.sbws] [INFO] sbws 0.7.1-dev with python 3.5.3 on Linux-4.9.0-8-amd64-x86_64-with-debian-9.5, stem 1.6.0-dev, and requests 2.19.1
[2018-08-27 20:17:23,003] [sbws.util.stem] [INFO] Started and connected to Tor 0.3.3.9 (git-ca1a436fa8e53a32) via /home/matt/.sbws/tor/run/control
[2018-08-27 20:17:27,630] [sbws.globals] [CRITICAL] No enabled destinations in config
[2018-08-27 20:17:27,692] [sbws.lib.resultdump] [WARNING] Results files that are valid not found. Probably sbws scanner was not run first or it ran more than 7 days ago or it was using a different datadir than /home/matt/.sbws/datadir.

You shouldn't need a config file.

Hope that helps.

comment:5 Changed 12 months ago by juga

Hopefully https://github.com/pastly/simple-bw-scanner/pull/245 (#27341) would help to know what is needed.

comment:6 Changed 9 months ago by teor

Milestone: sbws 1.1

These changes can probably wait until sbws 1.1

comment:7 Changed 9 months ago by teor

Milestone: sbws 1.1sbws 1.2

Milestone renamed

comment:8 Changed 9 months ago by teor

Milestone: sbws 1.2sbws: 1.2.x

Milestone renamed

comment:9 Changed 9 months ago by teor

Milestone: sbws: 1.2.xsbws: 1.2.x-final

Milestone renamed

comment:10 Changed 9 months ago by teor

Milestone: sbws: 1.2.x-finalsbws: unspecified

Milestone renamed

Note: See TracTickets for help on using tickets.