Pacchetto per utilizzare l’immagine Docker ufficiale di sviluppo.
Installazione
curl -s https://laravel.build/example-app | bash
Si può cambiare example-app col nome del progetto
Utilizzo
Dentro il progetto, usare ./vendor/bin/sail [command] per eseguire comandi come artisan o comandi come
up -davvia il docker (detach)stopstoppa docker
Rebuild Docker
docker compose down -v
sail build --no-cache
sail up[?] Aggiornamento aprile 2025
pare che laravel.build sia stato rimosso dalla doc, ma è ancora raggiungibile. Url: https://laravel.build/larapuk Contenuto
docker info > /dev/null 2>&1
# Ensure that Docker is running...
if [ $? -ne 0 ]; then
echo "Docker is not running."
exit 1
fi
docker run --rm \
--pull=always \
-v "$(pwd)":/opt \
-w /opt \
laravelsail/php84-composer:latest \
bash -c "laravel new larapuk --no-interaction && cd larapuk && php ./artisan sail:install --with=mysql,redis,meilisearch,mailpit,selenium "
cd larapuk
# Allow build with no additional services..
if [ "mysql redis meilisearch mailpit selenium" == "none" ]; then
./vendor/bin/sail build
else
./vendor/bin/sail pull mysql redis meilisearch mailpit selenium
./vendor/bin/sail build
fi
CYAN='\033[0;36m'
LIGHT_CYAN='\033[1;36m'
BOLD='\033[1m'
NC='\033[0m'
echo ""
if command -v doas &>/dev/null; then
SUDO="doas"
elif command -v sudo &>/dev/null; then
SUDO="sudo"
else
echo "Neither sudo nor doas is available. Exiting."
exit 1
fi
if $SUDO -n true 2>/dev/null; then
$SUDO chown -R $USER: .
echo -e "${BOLD}Get started with:${NC} cd larapuk && ./vendor/bin/sail up"
else
echo -e "${BOLD}Please provide your password so we can make some final adjustments to your application's permissions.${NC}"
echo ""
$SUDO chown -R $USER: .
echo ""
echo -e "${BOLD}Thank you! We hope you build something incredible. Dive in with:${NC} cd larapuk && ./vendor/bin/sail up"
fi