When using docker, I encountered such a problem:
My php project uses composer to install extensions. I want to update every time I run docker, and also run it.php start.php
This forms two commands that need to be executed in the cmd of the docker containercomposer update
Andphp start.php
But if I do thiscomposer update; php start.php
In the actual docekr containerupdate; php
As a parameter to analyze the use of&&
The same is true for separators, as follows
Do not run Composer as root/super user! See https://getcomposer.org/root for details
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "update&&" is not defined.
Did you mean this?
update
What am I supposed to do? Said to create a batch file, I thank you all, I already know this
I don’t know which way you started docker and which way you executed the command.
Let’s take the command line to start docker as an example to execute multiple commands in sequence.
docker run ... /bin/bash -c "composer update; php start.php;"