// docs

Docker connections

Run Laravel snippets inside an existing local Docker container.

Use a Docker connection when the app only boots correctly inside a container. LaraBench talks to the container with docker exec and runs code from the Laravel app path inside that container.

  1. Make sure Docker is running.
  2. Find the container that can run php artisan.
  3. Open Connections and choose Docker.
  4. Enter the container name.
  5. Set the Laravel app path inside the container.
  6. Optionally set the run-as user if your container needs one.
  7. Test the connection before using it in Run Code.
docker ps

docker exec -it my-workspace php artisan about