Home > database >  How to handle prompt in Docker Exec
How to handle prompt in Docker Exec

Time:10-11

I try to execute the following line:

docker exec --user www-data nextcloud_docker php /var/www/html/occ db:convert-filecache-bigint

which returns a prompt:

This can take up to hours, depending on the number of files in your instance!
Continue with the conversion (y/n)? [n]

Unfortunately the docker exec command ends (returns to shell) and I am not able to start the occ command.

How can I solve this?

Thanks.

CodePudding user response:

You can try setting the -i flag on the docker command and piping a 'y' into it, like this

echo y | docker exec -i --user www-data nextcloud_docker php /var/www/html/occ db:convert-filecache-bigint

or you can run the command fully interactively with the -it flags like this

docker exec -it --user www-data nextcloud_docker php /var/www/html/occ db:convert-filecache-bigint
  • Related