audreyfeldroy/docker-cookiecutter

Write output to the current working dir of the host machine

audreyfeldroy opened this issue · 4 comments

I think the way to do it would be:

  • Mount host's working directory as /outputdir
  • Use cookiecutter -o /outputdir

Hi there,

you could use something like this in your docker run command:

-v `pwd`:/outputdir

to mount the current hosts working directory to the container's /outputdir.
Hope this helps.

Cheers.

As an example, I was able to get it work:

docker run --rm -ti -e LC_ALL=C.UTF-8 -v d:/VSProjects/azure-sdk-for-python:/mydir cookiecutter/cookiecutter -o /mydir /mydir/cookiecutter-swagger-package/

where I mount d:/VSProjects/azure-sdk-for-python as /mydir and I generate the result on it.

So, from my point of view the container is fully functionnal :)

I just suggest you to include the UTF8 stuff inside the container, so we can avoid specifying it each time.

Edit: There is several solution to avoid specifying UTF8 on the line:
http://askubuntu.com/a/582197

@audreyr docker lets you set your working directory through the cli

docker run -v $PWD:/srv/app -w /srv/app audreyr/docker-cookiecutter:latest cokiecutter https://github.com/myself/mycool-cut.get

should create a directory right in from of you!
I am more concerned with the privileges of the created project in order to solve this dnephin/dobi#52

Hi, a fix is proposed in this pull request: #8