johnlpage / POCDriver

Workload Driver for MongoDB in Java
Other
204 stars 87 forks source link

Add Docker support #12

Closed pataquets closed 7 years ago

pataquets commented 7 years ago

Add Dockerfile to enable image building from source. Using the official Maven image, 'latest' tag. If another version is needed/required/desirable, say so and I'll pin the parent image. More info at https://hub.docker.com/_/maven/

Just adding files and setting working dir. Entrypoint just runs plain jar file. Hostnames such as localhost won't work, since nothing else apart from the program runs inside the container, you have to look for the MongoDB server elsewhere outside the container by other means (a reachable IP, a Docker inter-container link, etc.)

Build:

$ docker build -t pocdriver .

Run (assuming an already running MongoDB listening on your LAN 192.x.x.x interface):

$ docker run --rm -it --name pocdriver pocdriver --host mongodb://192.x.x.x:27017 [other options...]

FYI, there's a still quicker to test, already built image on my Docker Hub. Test it by running:

$ docker run --rm -it --name pocdriver pataquets/pocdriver --host mongodb://192.x.x.x:27017 [other options...]

Using --rm instead of -d makes the container not go background. Stop it by CTRL+C'ing it.

Optional improvement to come:

pataquets commented 7 years ago

@johnlpage ping?

johnlpage commented 7 years ago

Sorry - didn't see this until now. I personally have no interest in working with Docker but am happy to merge this for you.

pataquets commented 7 years ago

@johnlpage : Nothing to be sorry of. I've already figured you didn't get the notice. Thanks for sharing this software and merging this.

Although you have stated that you are not interested in Docker (which, of couse, is fine) I wonder if you would be so kind of setting up an Automated Build Docker image on Docker Hub to make available a runnable built artifact for use by others in the Docker workflow. It would be fine to make a disclaimer in the readme (I can send a PR) o even not announce it anywhere if you can't support it. I understand not wanting further burden with the Docker stuff, it might be an 'use on your own' image.

Others (myself included) could create ABs from our own forked repos, but we would have to chase upstream and pull on each change to keep our ABs up-to-date. If you create it, it will be built automatically on each commit, since it's a "set it and forget it" one time process. This would add an easy distribution/packaging method and ease & increase usage (and hopefully attract eyeballs and more contributors). See also this issue's last paragraph and do not hesitate to ping me if you need assistance on it, if you feel like setting it up.

In every case, thanks again for all.

renatoriccio commented 7 years ago

Concerning Docker I created pull request #14 for using the multi-stage build and reducing the size of the final image