/laravel-spatie-composer

Docker files that loads in requirements to use Spatie's laravel-medialibrary when doing a fresh sail install for local work

Primary LanguageDockerfileMIT LicenseMIT

Docker Hub

https://hub.docker.com/repository/docker/dschreck/laravel-spatie-composer

About

When using Laravel and Sail it's preferred to avoid installing PHP and composer locally. This can be solved by using composer directly from Docker Hub.

The gotcha here is when you'd like to also use Spatie's laravel-medialibrary. As it asks for some additional libraries to be installed.

This is my quick hack solution to it.

Other's may have better ones, but this is mine šŸ¤·

Use

# change director to your local fresh checkout (sans `vendor` folder)
docker run --rm \
    -v "$(pwd)":/app \
    -w /app \
    dschreck/laravel-spatie-composer:latest \
    composer install

Rebuild

# build
docker build -t dschreck/laravel-spatie-composer .

# login to docker
docker login

# push
docker push dschreck/laravel-spatie-composer:latest