bashdockergit-bashshopware6docker-exec

Shopware 6: How to set boolean config values with Docker exec in Git Bash


I'm running a Bash script on Windows Git Bash that uses docker exec to set config values in my Shopware container:

docker exec -d $SHOPWARE_CONTAINER_ID php bin/console system:config:set $PLUGIN_NAME.config.active true

But I get an error that the config value must be a boolean, not a string. It seems passing "true" from Bash sets it as a string, when it needs to be a proper bool value. How can I properly set a boolean config value true/false from a Bash script using docker exec?


Solution

  • I solved this issue by using -j (-json) to decode the true as a bool.

    docker exec  $SHOPWARE_CONTAINER_ID php bin/console system:config:set -j $PLUGIN_NAME.config.active true