digininja / CeWL

CeWL is a Custom Word List Generator
1.96k stars 258 forks source link

add docker #52

Closed greenmind-sec closed 4 years ago

greenmind-sec commented 5 years ago

add support docker

digininja commented 5 years ago

I'm not a Docker user at all and don't know anything about setting it up so will have to defer this to some friends to check. I'll see what I can find and get back to you.

But thanks for the submission.

digininja commented 5 years ago

It should do. Test it without that line and see if it still works.

greenmind-sec commented 5 years ago

It works without problems.

digininja commented 5 years ago

Just tried it and it worked to run, only problem, specifying the -w option to write the output to disk, I didn't get a file. I assume the file is inside the docker container somewhere. How do I get it out? That would need to go into the instructions I think.

greenmind-sec commented 5 years ago

I will add in README.md, just perform the command using the -v "$ {PWD}: / root" option, so it creates a link to the current directory to the container directory /root.

Complete command: sudo docker run -it --rm -v "${PWD}:/root" "greenmind/cewl:1" -h

loris-intergalactique commented 4 years ago

Hi guys, I suggest using a more lightweight Dockerfile :

FROM ruby:2.5-alpine
# Using Alpine makes the Dockerfile lighter, and removes unnecessary artifacts

ENV RUBYOPT "rubygems"

COPY Gemfile /usr/src/CeWl/
WORKDIR /usr/src/CeWl
# We start by only giving the Gemfile to the container in order to make faster Docker builds

RUN set -ex \
    && apk add  --no-cache --virtual .build-deps \
                build-base \
    \
    && gem install bundler \
    && bundle install \
    && apk del .build-deps
# Having no additionnal tools, we only need to add build-base in order to build nokogari.
# The last line (apk del) is going to remove unnecessary packages.

COPY . /usr/src/CeWL
# We move the rest of the package, ready to go ! :)

ENTRYPOINT ["/usr/src/CeWL/cewl.rb"]

May I make another Dockerfile ?

digininja commented 4 years ago

Go for it.

I know nothing about Docker so anything that is submitted will be ran past a few friends who do know it very well, so any feedback will be second hand.

loris-intergalactique commented 4 years ago

Go for it.

I know nothing about Docker so anything that is submitted will be ran past a few friends who do know it very well, so any feedback will be second hand.

Done in #61 :)

digininja commented 4 years ago

Can you compare your version with this one and comment:

https://github.com/digininja/CeWL/pull/61

digininja commented 4 years ago

Gone with an alternate version. Thanks for the input