I needed to specify the command in exec form
as per the docs:
command: ["python", "manage.py", "migrate"]
The migrations ran successfully.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm deploying a django app to azure container instances using a yaml file.
I have an init container using the my custom docker image hosted in acr to run database migrations before the rest of the containers are deployed.
The command the init container needs to run is very simple: python manage.py migrate
, however I'm getting the following log message and the stack doesn't deploy:
container_linux.go:247: starting container process caused "exec: \"python manage.py migrate\": executable file not found in $PATH"
The thing is, when I run this image locally, or in another deployed container, I have no trouble running this command. In fact, previously before I had discovered init containers, I had a container in the main group that would run this command and then shut down, no problems.
I've also tried using the absolute path of python, which returned the following log message:
container_linux.go:247: starting container process caused "exec: \"/usr/local/bin/python manage.py migrate\": stat /usr/local/bin/python manage.py migrate: no such file or directory"
I needed to specify the command in exec form
as per the docs:
command: ["python", "manage.py", "migrate"]
The migrations ran successfully.