ahmadreza1383's avatar

The EasySail repo for simplifying working with Sail.

Hey Laravel community! šŸ‘‹

I’ve been working on a new package called EasySail: github.com/karbordia/easysail

The goal of this package is twofold:

  1. Provide a reliable source of pre-built Laravel Sail images so you don’t have to rebuild them every time.
  2. Eliminate extra dependencies like installing Composer or PHP on your host machine.

Eventually, I’m planning to add a CLI tool to make working with Sail even easier. Imagine something like:

  • Creating a new project:
apt install easysail
easysail new example-app --sail=8.4
  • Or working with an existing project:
easysail -p ./example-app --sail=8.4

I’d love to hear your thoughts, feedback, or any suggestions on this approach!

UPDATE:

Thanks for the feedback everyone.

I think there’s no need to build a CLI tool anymore.

But I’ll keep this repo to have the Sail images ready, so anyone who needs them can just download and use them anytime(Especially for Iran)

0 likes
8 replies
ian_h's avatar
ian_h
Best Answer
Level 20

I'm sure the docs used to mention it somewhere, but if you're going for a containerised approach, you'd run composer in a container too, eg:

docker run --rm \
    -u "$(id -u):$(id -g)" \
    -v $(pwd):/var/www/html \
    -w /var/www/html \
    composer/composer:latest \
    composer req laravel/sail --dev

I haven't installed PHP locally for nearly a decade.. and on the 2 occassions I needed to use Sail, it installed just fine running composer in a container.

While I commend you on looking into writing a package... it's ultimately a solution looking for a problem.

ahmadreza1383's avatar

Thanks for your feedback! I’m really glad we’re on the same page — having both PHP and Sail installed together can definitely feel a bit messy and overwhelming. Your solution is actually very clean and simple, and honestly, I’m happy I asked for feedback. I realized that I can simplify some parts to make the usage process of EasySail smoother, and as I mentioned before, also add a CLI tool alongside it.

ahmadreza1383's avatar

While I commend you on looking into writing a package... it's ultimately a solution looking for a problem.

I don’t know which country you’re in, but maybe it’s not even a problem for you — and that’s totally fine, I respect that.

But for me, it is a problem, so I’d prefer to at least build it for myself :)

ian_h's avatar

I'm based in London, UK.. so granted, internet here is pretty stable (though I do understand your pain as it was only a few years ago that this property had access to something decent, before that, it was 3Mbps/0.8Mbps up/down.. which wasn't fun when your 2 young lads also wanted to stream separate youtube videos 😃).

I also think that building pre-configured stuff for yourself isn't a bad idea either, especially if it's something you use reguarly (I have multiple pre-configured docker images that I use for myself for pure convenience and then use a Makefile to run various commands inside/outside of the container(s)).

I guess context is key for this too.. it may well in some situations be far easier/more convenient/efficient to download a single docker image than a base image and then a bunch of dependencies.

Good luck with your project šŸ‘šŸ»

1 like
martinbean's avatar

Actually, they install it

@ahmadreza1383 Not true. I have an M2 MacBook Pro that I bought over a year ago now, and so far have not installed PHP or Composer on it. I run composer commands using the Composer Docker image (which I’ve aliased):

composer () {
	docker run --interactive --rm --tty --volume $PWD:/app --volume ${COMPOSER_HOME:-$HOME/.composer}:/tmp composer $*
}

It means I can run composer commands on my machine like normal, but it uses Composer inside a Docker image rather than a composer binary on my actual machine. This is also how I install Sail in new applications.

ahmadreza1383's avatar

My goal with this project is mainly two things:

First, I think it’s a bit unfair that we have to build Sail the first time we use it. Maybe in developed countries with fast internet, this isn’t really a problem — the build might even finish in under a minute (which honestly makes me a bit jealous šŸ˜…). But where I live, because of slow internet, sanctions, packet loss, and other issues, building something like this can literally waste an entire day.

So, I’ve prepared multiple pre-built releases of different Sail versions to solve this problem. Each release is built automatically using GitHub Actions, and I haven’t modified the Dockerfiles at all — except for the mini versions, where I removed Node.js, pnpm, bun, and yarn to reduce the image size for users who don’t need them.

Second, since the images are already built, Sail is basically ready to go. Users just need to load the image and can create their Laravel project directly from it, without any building or installing anything extra on their host system

Please or to participate in this conversation.