From 62df4ec3de57f458063cbb7202abd53ca0c23241 Mon Sep 17 00:00:00 2001 From: James Polley Date: Sun, 17 Sep 2017 12:51:10 +1000 Subject: [PATCH] Allow flags for migrations Switch Dockerfile from CMD to ENTRYPOINT so that flags can be passed to the makemigrations command This is required in cases where we need to use django's makemigrations --merge to merge two migrations. --- docker/Dockerfile.makemigrations | 2 +- makemigrations.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile.makemigrations b/docker/Dockerfile.makemigrations index a529085e..5cf1dfeb 100644 --- a/docker/Dockerfile.makemigrations +++ b/docker/Dockerfile.makemigrations @@ -18,5 +18,5 @@ RUN set -ex \ && apt-get install -y git xmlsec1 libmysqlclient18 \ && apt-get install -y $buildDeps --no-install-recommends RUN pip install -c /setup/constraints.txt -r /setup/requirements.txt -CMD ["python","/source/manage.py", "makemigrations"] +ENTRYPOINT ["python","/source/manage.py", "makemigrations"] diff --git a/makemigrations.sh b/makemigrations.sh index c59c5a49..c150e271 100755 --- a/makemigrations.sh +++ b/makemigrations.sh @@ -1,4 +1,4 @@ #!/bin/bash -x docker image build -f docker/Dockerfile.makemigrations -t makemigrations . -docker run -it --env-file=docker/laptop-mode-env -v $(pwd):/source makemigrations +docker run -it --env-file=docker/laptop-mode-env -v $(pwd):/source makemigrations $*