Unable to run CLI commands on official Docker images #19513
|
Hi. If I want to run an unattended command (like in a cloud environment), I'm unable to bypass that check, and thus I'm unable to run the command... The image should be shipped with a compatible php version |
Replies: 1 comment 3 replies
|
You've hit an actual inconsistency in the command rather than doing anything wrong — In // ~line 149
if (! $this->option('force')) {
$confirmation = $this->confirm('WARNING: This command will display your LDAP password on your terminal. ...');// ~line 207
if (! $this->option('force')) {
$confirmation = $this->confirm('WARNING: This command will make several attempts to connect to your LDAP server. ...');but the PHP-version one isn't: // ~line 200
$this->warn("PHP Version: $php_version WARNING - Versions before 8.3.21 or 8.4.7 will return INCONSISTENT results!");
if (! $this->confirm('Are you sure you wish to continue?')) { // <- no option('force') check
$this->warn('ABORTING');
exit(-1);
}Given Why Working around it today, feed the prompt on stdin — note the docker run --rm -i snipe/snipe-it:v8.7.1 \
sh -c 'yes | php artisan ldap:troubleshoot --force'
On the image's PHP version — you're reading it right. The Dockerfile is That's arguably the more useful thing for the maintainers here: the guard is a straight |
I've filed it — PR is up at #19514, since I had the file open anyway.
It just wraps that confirmation in the same
if (! $this->option('force'))the other two already use, and leaves thewarn()outside the guard so the caveat still shows up in unattended logs even when the prompt is skipped.php -lis clean; withconfirm()stubbed to what a non-interactive run returns,--force=falsestill aborts and--force=truenow continues, so nothing changes for the interactive path.On the distro question — I'd gently push back on reaching for the Ondřej PPA. Ubuntu's
8.3.6-*ubuntu*Nis a security-supported build with fixes backported and the upstream version string left alone, so it may well already …