I would like to be able to use the Stripe CLI from within the Laravel Sail terminal, meaning that I'd like to be able to issue commands such as sail strip login
or, even better, just stripe login
from within a Devcontainer terminal.
Assuming you already have a Laravel project with Sail installed and working:
Publish the Dockerfile of Laravel Sail following the docs by running sail artisan sail:publish
or php artisan sail:publish
depending on your context
In your project root, there will now be a docker
folder. Navigate to the php version specified in your docker-compose.yaml
file which is also in the project root.
Locate && apt-get update \
and replace with the following:
&& curl -sS https://packages.stripe.dev/api/security/keypair/stripe-cli-gpg/public | gpg --dearmor | tee /etc/apt/keyrings/stripe.gpg >/dev/null \
&& echo "deb [signed-by=/etc/apt/keyrings/stripe.gpg] https://packages.stripe.dev/stripe-cli-debian-local stable main" | tee /etc/apt/sources.list.d/stripe.list \
&& apt-get update \
&& apt-get install -y stripe \
Run the command sail build --no-cache
or otherwise rebuild your container (ie: from the Deccontainer menu in VS Code, Storm etc)
You will now be able to issue commands such as sail stripe login
or even stripe login
if you're using a Devcontainer terminal.