mrsarm / mongotail

Command line tool to log all MongoDB queries in a "tail"able way
https://pypi.org/project/mongotail/
GNU General Public License v3.0
192 stars 17 forks source link

Add docker support #16

Closed FGRibreau closed 7 years ago

mrsarm commented 7 years ago

@FGRibreau thanks for the patch! However, I cannot run successfully the command suggested in the README to launch the Docker container:

$ docker run -it --rm mongotail --help
Unable to find image 'mongotail:latest' locally
Pulling repository docker.io/library/mongotail
docker: Error: image library/mongotail:latest not found.
See 'docker run --help'.

I suppose that you don't have this error because the image was created by you locally.

I saw the the image created int the Docker Hub, and after pull the image and run the the same command but changing its image name to fgribreau/mongotail works OK.

Anyway, I think that in any project like this there is two way to run with Docker the project, (1) from a public image without the source code, (2) and building the image locally from the source code:

  1. With a public image like your image. In this case in the README you put just the command to run with docker without the need to clone this source code repository and without a Dockerfile in the root folder of the source code (maybe in a root folder called docker, because that Dockerfile is only used by the publisher in Docker Hub). So the command to run it will docker run -it --rm fgribreau/mongotail.
  2. Building locally the image from the source code, in that case you put a Dockerfile in the root folder of the source code, but you have to replace the RUN pip install mongotail with something like RUN python setup.py install (not tested).
FGRibreau commented 7 years ago

I saw the the image created int the Docker Hub, and after pull the image and run the the same command but changing its image name to fgribreau/mongotail works OK.

Indeed, my bad, I fixed it :)

I had the issue with mongotail, wanted to use it through docker, found the fastest way and did it. But indeed a complete build (with intermediate step removal for build files) would be a better idea (and it would leverage docker automated build as well)