-
Notifications
You must be signed in to change notification settings - Fork 130
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
Dockerized testenv #8
Conversation
My comments:
p.s. in plain speak: can't automatically pull the request because of all those files laying around the root directory (as we in sqlmap tend to keep stuff structured as much as we can). Also, introducing of CircleCI is unneeded (at least for us) |
Just for the record, the files related with CircleCI builds are:
These files are required to have continuous delivery of IMHO, if it's already done, why not keep it? If we decide that that's something we want I could replace the
Agreed. Moved It's not possible to move the "Dockerfile" outside the repository root because of how "docker build" works together with
This is a little bit complicated to achieve given the previous limitation of Dockerfiles. The workaround would be to create a
I'm unsure about how you guys use the Another question that appears is if the different docker images for each DBMS wouldn't have a lot in common, and a change in one would require a change in many (not sure about this one) Finally, would you push "testenv-mysql", "testenv-pgsql", etc. to the registry? I believe that the benefits of splitting this up are:
And the problems are:
Yes, that could be done too (if you don't like docker stuff to be in this repo). IMHO the power of docker is to have continuous delivery of docker images on each change you make to the registry. This allows users to run the
"all those files", oh my, you're OCD is worse than mine! After the change I introduced, the only files are |
@stamparm ping 📣 |
Just to discuss with @inquisb. Will let you know. |
@andresriancho p.s. my OCD powers are strong :). I am fully aware of that fact. |
Sorry for waiting. We internally decided to stick with most simple solution. One Docker file and that's it. No Circle or similar. |
@stamparm so, the files that I should keep in this PR are:
Also, the fix for Do we agree on that? If so I'll remove the extra files and PR is merged, correct? PS: I'll most likely keep the circle.yml stuff in my fork |
@andresriancho yup. It sounds ok. Later we'll do more modifications |
Closing this PR, opening a new one. |
This pull request allows users to run
testenv
inside docker. In order to usethis new feature users need to run the following command:
docker-compose --project-name test up
And then access
http://localhost:8998/
, the port where thetestenv
will listenis defined in the
docker-compose.yml
file:In the future, and if this PR is accepted, the
testenv
image would be insqlmapproject
instead of
andresriancho
.At the moment only the
mysql
part was implemented (because that's what I'm using in w3af),but adding more databases should take less than an hour (each).
Docker has many incredible features, one of the most important ones for the
testenv
isthe fact that we can change the mysql version by specifying it in the docker compose file:
No installation required, no configuration changes, just adding
:5.5
will run a different mysqlversion in the container.
The
testenv
main server is defined inDockerfile
which would be the file to extend whenadding more databases. People extending this should follow the design concept of using other
containers for the databases (whenever possible). These external containers most likely exist
and can be re-used, instead of installing inside the main container.
The final part in all this magic is the continuous delivery aspect which is implemented in
circle.yml
,note that this file is run by CircleCI (free CI system for open source projects) and the main steps
are:
So each time someone makes a change to the repo (for now mine, but in the future the testenv) the
image in the registry is updated and all the users get the latest when running
docker-compose --project-name test up
If in the future you decide to use CircleCI and want to push to the docker registry, you'll have to
set the right environment variables in your build configuration (so CI can auth to the registry). Those
variables are
DOCKER_EMAIL
andDOCKER_AUTH
This work is part of my efforts to dockerize all of w3af's test dependencies