-
Notifications
You must be signed in to change notification settings - Fork 477
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
docker-compose: command not found #363
Comments
Ping @ribeirobreno ^ |
If I prefix all |
I've installed ZSH ( The actual bug is probably not related to "Oh My Zsh" but running sail under any non-bash terminal while not having a Compose v1 executable. I'm setting up a VM with Ubuntu 21.10 and no This is what I have right now: $ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
$ zsh --version
zsh 5.8 (x86_64-ubuntu-linux-gnu)
$ bash --version
GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
$ docker compose version
Docker Compose version v2.2.3
$ docker-compose version
docker-compose version 1.29.2, build 5becea4c
docker-py version: 5.0.0
CPython version: 3.7.10
OpenSSL version: OpenSSL 1.1.0l 10 Sep 2019
$ docker version
Client: Docker Engine - Community
Cloud integration: v1.0.22
Version: 20.10.12
API version: 1.41
Go version: go1.16.12
Git commit: e91ed57
Built: Mon Dec 13 11:45:48 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Desktop
Engine:
Version: 20.10.12
API version: 1.41 (minimum version 1.12)
Go version: go1.16.12
Git commit: 459d0df
Built: Mon Dec 13 11:43:56 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.12
GitCommit: 7b11cfaabd73bb80907dd23182b9347b4245eb5d
runc:
Version: 1.0.2
GitCommit: v1.0.2-0-g52b36a2
docker-init:
Version: 0.19.0
GitCommit: de40ad0 |
Yes, I am researching for Laravel Sail supported docker compose V2 with aliasing
But somehow this alias is not working anymore. For now I've added |
This is also working for me. I have read some articles right now and command substitution and using an alias in a bash script is not recommended. It worked without But maybe we have to change first lines 3-6 to a shell function now. https://www.gnu.org/software/bash/manual/html_node/Aliases.html
|
But if you create the alias and use it as the composer v1 it works as expected:
The script for some reason store the So when this variable is called like this Here's some little test I did: #!/usr/bin/env bash
shopt -s expand_aliases
alias e='echo'
ECHOING=(e)
ECHOING2=e
e 'WORK'
"${ECHOING[@]}" 'DOES NOT WORK'
"${ECHOING2[@]}" 'DOES NOT WORK' And runs...
|
If I read the bash reference correctly, we have to overwrite the docker-compose function with a shell function. With the new command variable DOCKER_COMPOSE an alias will no longer work. https://www.gnu.org/software/bash/manual/bash.html#Aliases
Thank you @FaruNL for this nice demo. |
This fixes it and still works under my other envs (Mac and WSL2): Requirements:
A minimal environment to test the issue: https://gist.github.com/ribeirobreno/e37f817e7cfa60f4e20021707feeaf8c To test:
|
@affektde can you try out @ribeirobreno's solution? |
Testest, but we have to switch if-else I think. If Or just remove |
I've went ahead and created a PR to speed up things in case this works. :) |
Yes! You are correct @affektde ! I did remove the |
Updated the PR, should be good to go now. |
Description:
Laravel Sail was upgraded via
composer update
today.We use
docker compose
instead ofdocker-compose
on our system.Before Version 1.13.17 we had now issues with Sail.
This commit introduced this new line here:
DOCKER_COMPOSE=(docker-compose)
: 2092e1cFollowing errors now occur:
Steps To Reproduce:
Linux with "Oh My Zsh"
and following line in .zshrc:
alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail'
If I echo out
It says:
I try to find out, what is special on my environment, that
docker-compose: command not found
is happening.The change
docker-compose
to"${DOCKER_COMPOSE[@]}"
, seems to have a side-effect.The text was updated successfully, but these errors were encountered: