diff --git a/Dockerfile b/Dockerfile index bbb5200..ac8243d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,16 @@ -FROM alpine:3.2 +FROM alpine:3.7 MAINTAINER Ivan Pedrazas RUN apk add --update \ - python \ - python-dev \ - py-pip \ - g++ && \ - pip install cookiecutter && \ - apk del g++ py-pip python-dev && \ - rm -rf /var/cache/apk/* + git \ + python \ + python-dev \ + py-pip \ + g++ && \ + pip install cookiecutter && \ + apk del g++ py-pip python-dev && \ + rm -rf /var/cache/apk/* && \ + printf "#!/bin/sh \ncookiecutter -o \$OUT_DIR \$TEMPLATE" > start.sh && \ + chmod +x start.sh - -ENTRYPOINT [ "cookiecutter" ] +CMD ["./start.sh"] diff --git a/README.md b/README.md index 0e35a6a..9291d2f 100644 --- a/README.md +++ b/README.md @@ -2,16 +2,20 @@ Cookiecutter in a Docker container. -This almost works. I'm just stuck on figuring this out: - -* https://github.com/audreyr/docker-cookiecutter/issues/1 +This writes output to the current working dir. Docker Hub repo: https://hub.docker.com/r/cookiecutter/cookiecutter/ # Usage - -``` -docker run -e LC_ALL=C.UTF-8 -t cookiecutter/cookiecutter gh:pydanny/cookiecutter-django +A sample command: + +```console +docker run -it --rm \ + -e LC_ALL=C.UTF-8 \ + -e TEMPLATE=gh:pydanny/cookiecutter-django \ + -e OUT_DIR=/cookie \ + -v $PWD:/cookie \ + cookiecutter/cookiecutter ``` # Contributing