Replies: 6 comments
-
Can you give all the commands you ran and any relevant files or logs for reproducing the issue If you're using an initialized volume then environment variables won't get changed |
Beta Was this translation helpful? Give feedback.
-
I'm running:
and get following:
printenv shows:
wp-cli debug:
note in the Final MySQL command it is using defaults from wp-config.php and not the env variables and was expected. If I replace wp-config.php with old style config then command works as expected. |
Beta Was this translation helpful? Give feedback.
-
Using the After setting up the site real quick I followed the $ docker run -it --rm \
--volumes-from wordpress_wordpress_1 \
--network container:wordpress_wordpress_1 \
-e WORDPRESS_DB_HOST=db \
-e WORDPRESS_DB_PASSWORD=examplepass \
-e WORDPRESS_DB_NAME=exampledb \
-e WORDPRESS_DB_USER=exampleuser \
wordpress:cli user list
+----+------------+--------------+--------------+---------------------+---------------+
| ID | user_login | display_name | user_email | user_registered | roles |
+----+------------+--------------+--------------+---------------------+---------------+
| 1 | admin | admin | [email protected] | 2022-07-06 17:22:13 | administrator |
+----+------------+--------------+--------------+---------------------+---------------+ |
Beta Was this translation helpful? Give feedback.
-
@wglambert thanks for your feedback and testing, I will review our custom image and see if I can identify why it behaves differently. I saw others had the same issue on wpcli github issues page and had a workaround. |
Beta Was this translation helpful? Give feedback.
-
@dbrosy Can you please share the solution as I'm also having the same issue, where the |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
This is frustrating,
my wp-config.php no longer has database connection setting set. Instead it has getenv_docker...
if I use wp db check this fails as it is trying to connect to mysql
I have set environment variables 'WORDPRESS_DB_HOST' etc but its not reading them
using wp cli 2.6.0
I see lots of people having issues but no solutions.
if I set database credentials via env variables should wpcli read the variables?
Beta Was this translation helpful? Give feedback.
All reactions