solve:
method one:
-
Check the current directory:
make sure you are in the correct directory where the configuration file is located. You can use the command "pwd" to check the current directory. -
Check the parent directory:
If the configuration file is not in the current directory, you can use the command "cd .." to move up one level until you find the directory containing the configuration file. -
Search configuration file:
If you still can't find the configuration file, you can use the command "find / -name <filename>" to search for the configuration file. Replace <filename> with the actual configuration file name. -
Create a new profile:
If a profile is missing, you can create a new profile from scratch, or use a sample profile as a template. -
Check Permissions:
Make sure you have the required permissions to access the configuration file. You can use the command "ls -l" to check file permissions.
Method Two:
- You can first execute find . -name "docker-compose.yml" in the corresponding path to ensure that the file does exist
- Query the docker-compose version through docker-compose-version, sometimes because the version is too low to find the file
- Delete the old version docker-compose by rm /usr/local/bin/docker-compose
- You can find the latest version on github https://github.com/docker/compose/releases
- Download and install the latest docker-compose
curl -L https://github.com/docker/compose/releases/download/1.26.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
Reference: https://blog.csdn.net/web18296061989/article/details/123870365