Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAIL_FILE environment variable prevents using docker-compose.override.yml #354

Closed
bramdevries opened this issue Mar 9, 2022 · 1 comment · Fixed by #355
Closed

SAIL_FILE environment variable prevents using docker-compose.override.yml #354

bramdevries opened this issue Mar 9, 2022 · 1 comment · Fixed by #355

Comments

@bramdevries
Copy link
Contributor

bramdevries commented Mar 9, 2022

  • Sail Version: 1.13.6
  • Laravel Version: 9.4.1
  • PHP Version: 8.0 / 8.1
  • OS: macOS 12.2.1

Description:

As part of a project using Laravel Sail, I use a docker-compose.override.yml file to configure certain things specific to my environment, such as using NFS mounts. This relies on the functionality available as part of docker-compose (see https://docs.docker.com/compose/extends/#multiple-compose-files).

An example of such a file is below:

version: "3"
services:
  laravel.test:
    volumes:
      - code:/var/www/html
volumes:
  code:
    driver: local
    driver_opts:
      type: nfs
      o: addr=host.docker.internal,rw,nolock,hard,nointr,nfsvers=3
      device: ":${PWD}"

By introducing the SAIL_FILE environment variable and allowing you to configure the .yml file used this is no longer working like before.

One option I've found is to define the SAIL_FILE environment variable like so:

SAIL_FILE="docker-compose.yml -f docker-compose.override.yml"

This works but gives a warning during sail up and prevents other commands such as sail artisan from working

stat /redacted/app/docker-compose.yml -f docker-compose.override.yml: no such file or directory
stat /redacted/app/docker-compose.yml -f docker-compose.override.yml: no such file or directory

When running sail artisan:

stat /redacted/app/docker-compose.yml -f docker-compose.override.yml: no such file or directory
stat /redacted/app/docker-compose.yml -f docker-compose.override.yml: no such file or directory
Sail is not running.

You may Sail using the following commands: './vendor/bin/sail up' or './vendor/bin/sail up -d'

I realise most people don't use Sail in this way but I also feel that the default docker-compose behaviour should not regress.

Steps To Reproduce:

  1. Create a docker-compose.override.yml file in a repository using sail. For example:

    version: "3"
    services:
      	hello-world:
    	  image: hello-world
  2. Run sail up

  3. The hello-world service will not be started.

@potsky
Copy link

potsky commented Mar 10, 2022

We use docker-compose.override.yml in our team for employees with new MacBookPro (M1 CPU):

services:
  selenium:
    image: 'seleniarm/standalone-chromium'

We run now docker-compose up instead of sail up to trick ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants