PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, October 18, 2022

[FIXED] How to handle prompt in Docker Exec

 October 18, 2022     docker, exec, nextcloud     No comments   

Issue

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.


Solution

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


Answered By - Hans Kilian
Answer Checked By - Cary Denson (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing