ERROR: Can‘t find a suitable configuration file in this directory or anyparent. Are you in the right

 

solve:

method one:

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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:

  1. You can first execute find . -name "docker-compose.yml" in the corresponding path to ensure that the file does exist
  2. Query the docker-compose version through docker-compose-version, sometimes because the version is too low to find the file
  3. Delete the old version docker-compose by rm /usr/local/bin/docker-compose
  4. You can find the latest version on github https://github.com/docker/compose/releases
  5. 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

Guess you like

Origin blog.csdn.net/weixin_42151235/article/details/129155618