Answer the question
In order to leave comments, you need to log in
How to run a command (doctrine migration) through a completed container?
There is a cli container through which you can run commands with some kind of magic. The container itself contains some basic advanced settings and dependencies for everything to work correctly. However, there is a problem - I do not know how to use it, because when you start it immediately exits, which seems to be the norm for him. Plus, the command has already been run through it once, only now I forgot how.
And the question is: how can I run a command through the released container? If important, then the doctrine migration command
Answer the question
In order to leave comments, you need to log in
If you just run
docker run --rm -i <имя образа>:[тэг]
If you transfer, you need to throw some file or config into the container:
docker run --rm -i -v <файл на хостовой машине>:<файл в контейнере> <имя образа>:[тэг]
docker run --rm -i <имя образа>:[тэг] < "данные"
Alternative solution:
docker-compose run <cotainer-name> <command>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question