Level 1
Does anyone have experience customizing Sail in this way?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I want to be able to install a package using apt into the Sail container
eg sudo apt update && sudo apt install libxrender1.
I know I can add a line to to the Sail Dockerfile, but that would be overwritten every time that package updates.
My current work around is to run every time I start Sail:
docker exec -u root {container_name} apt update
docker exec -u root {container_name} apt install libxrender1
Is there I can run a custom shell command every time I run sail up?
@rileys-cr laravel.com/docs/11.x/sail#sail-customization
sail artisan sail:publish
Publish the docker file and add your custom command to load each build time.
Please or to participate in this conversation.