Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] add docker-compose to manage volumes #56

Closed
rafonsecad opened this issue Jun 23, 2020 · 5 comments
Closed

[Request] add docker-compose to manage volumes #56

rafonsecad opened this issue Jun 23, 2020 · 5 comments
Labels
feature requests feature requests good first issue Good for newcomers priority: high priority to solve solved bugs that have been solved type: enhancement New feature or request

Comments

@rafonsecad
Copy link
Contributor

rafonsecad commented Jun 23, 2020

On the current wifipumpkin version, the docker container works great. Nevertheless it also has some limitations, specially in these two cases:

  • Every addition or modification of any pulp would mean to build the entire docker image again. This also applies when adding new plugins or changes in the configuration files.
  • There is no way to save any logs inside the docker container. Once the container stops, any data inside the container is destroyed.

Of course, these two issues can be solved simply by adding volumes, but to improve the management of the volumes it would be great to add a docker-compose file to the project. I've been making some tests and the docker-compose.yml looks like this:

version: '3.2'
services:
  wifipumpkin:
        build:
                context: .
        privileged: true
        network_mode: "host"
        volumes:
                - type: bind
                  source: ./scripts
                  target: /root/.config/wifipumpkin3/scripts
                - type: bind
                  source: ./logs
                  target: /root/.config/wifipumpkin3/logs
                - type: bind
                  source: ./config
                  target: /root/.config/wifipumpkin3/config

this file should be on the same folder level as the Dockerfile. Once installed docker-compose, one can run

$ docker-compose build wifipumpkin                    # To build the image
$ sudo docker-compose run wifipumpkin wifipumpkin3     # To run the image

As you can see in the docker-compose.yml, there are three volumes that points to folders in the project. We can add/edit configurations or pulps adding them in config or scripts folders respectively, and to view the logs in logs folder.

I also made a tiny change in the Dockerfile to set the working directory to /root/.config/wifipumpkin3, so it would be easier to call the pulps

...
RUN python3.7 setup.py install
#CMD /usr/local/bin/wifipumpkin3 -m docker # I don't know what this line is used for, I always get an error when I try to run it and in the current docker documentation it doesn't get executed anyways.
WORKDIR /root/.config/wifipumpkin3
CMD /usr/local/bin/wifipumpkin3

The command to call a pulp would be:

$ sudo docker-compose run wifipumpkin wifipumpkin3 --pulp scripts/my_pulp.pulp

I hope you like this request, if you have any questions, please don't hesitate to ask. This project is really cool, thanks for your dedication.

@mh4x0f mh4x0f added feature requests feature requests type: enhancement New feature or request priority: high priority to solve labels Jun 23, 2020
@mh4x0f
Copy link
Member

mh4x0f commented Jun 23, 2020

so, thank's for your contribuition. will be nice if you send me the pull request with this features.

if you clone the project only you want to do is create a fork and your config file and send me the banch draft. you can see this on this page contribution

thank's for great report, the first good report ;).

@mh4x0f mh4x0f added the good first issue Good for newcomers label Jun 23, 2020
@rafonsecad
Copy link
Contributor Author

Hi,
Here is the pull request: #57

@mh4x0f
Copy link
Member

mh4x0f commented Jun 23, 2020

wow, now I added on wp3 documenation ;). checkout! doc

@mh4x0f mh4x0f added the solved bugs that have been solved label Jun 23, 2020
@rafonsecad
Copy link
Contributor Author

Awesome, It's great to colaborate with this project.

@mh4x0f
Copy link
Member

mh4x0f commented Jun 26, 2020

now, the parameter -m docker is working fine ;), thank's for you report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature requests feature requests good first issue Good for newcomers priority: high priority to solve solved bugs that have been solved type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants