I am currently trying to run this command from my docker host:
docker exec container_name /bin/bash -c "touch .env; APP_KEY=$(php artisan key:generate | grep -o '\[.*]' | sed 's/[][]//g');"
Problem is that the expression $(expression) will be evaluated by the host, where php is not in the path, like it should be.
How do I tell docker that it should use container shell to evaluate the expression in the container? Or is there maybe another workaround to accomplish this?