some-programs / exitwp

Exitwp is tool primarily aimed for making migration from one or more wordpress blogs to the jekyll blog engine as easy as possible.
686 stars 145 forks source link

Docker support #59

Closed Bill closed 7 years ago

Bill commented 9 years ago

Added a Dockerfile and associated documentation.

thomasf commented 9 years ago

Thanks..

Wouldn't a volume mount be easier than using tar like that?

thomasf commented 9 years ago

I mean so you can do something like

docker run --rm -v $PWD:/src/app/ exitwp ....
Bill commented 9 years ago

Volume mounts are certainly an option. I was opting instead to run exitwp.py as part of building the image. That way the image contains the (built) output.

This image can, of course, be run with a volume mount:

docker run -it --rm -v $PWD:/usr/src/app/build --entrypoint python exitwp exitwp.py

That'll (re) run exitwp.py and put the results in $PWD.

The Dockerfile could be modified with that idea in mind by:

  1. removing the final RUN line
  2. replacing the final CMD with CMD ["python", "exitwp.py"]

With those changes, you could invoke it like this:

docker run -it --rm -v $PWD:/usr/src/app/build exitwp

Alternately, if you like building-in the build directory, but you don't like tar, you can use docker copy on a running container to copy out the build dir.

thomasf commented 8 years ago

Maybe it makes sense to supply a docker image with builds from dockerhub as well for people who cant be bothered to set up python virtualenv or whatever..

I think that many users of exitwp also needs to modify exitwp.py for their own migration needs so I'm not sure it's really helping much. I don't have time to do this now but I'll revisit it in while.