-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed as not planned
Labels
Description
Hi,
I've got a running WP-container with the following wp-config.php (official source):
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', getenv_docker('WORDPRESS_DB_NAME', 'wordpress') );
/** MySQL database username */
define( 'DB_USER', getenv_docker('WORDPRESS_DB_USER', 'example username') );
/** MySQL database password */
define( 'DB_PASSWORD', getenv_docker('WORDPRESS_DB_PASSWORD', 'example password') );
Then I want to execute a basic command but that fails due to the parsing of the database credentials
docker run -it --rm \
--volumes-from wp \
--network container:wp \
wordpress:cli-php8.0 user list
Error: Error establishing a database connection.
Is there any way how I can supply the credentials?
I can already extract them from docker-compose.yml using this:
db_name=$(grep -Po '(?<=WORDPRESS_DB_NAME: )(.*)' docker-compose.yml)
Reactions are currently unavailable