Skip to content

docker-compose up failed #119

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

Closed
Hanochhu opened this issue Oct 26, 2023 · 11 comments
Closed

docker-compose up failed #119

Hanochhu opened this issue Oct 26, 2023 · 11 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@Hanochhu
Copy link

Issue Description / 问题描述

when I run "docker-compose up", there is an ERROR.
"The Compose file './../docker-compose.yml' is invalid because:
networks.default value Additional properties are not allowed ('name' was unexpected)"

Steps to Reproduce / 复现步骤

download this project, run "cd ToolServer" then run "docker-compose up" in terminal.

Expected Behavior / 预期行为

Get docker stuff right

Environment / 环境信息

  • Operating System / 操作系统:wsl ubuntu20.04
  • Python Version / Python 版本:3.10.13
  • Other Relevant Information / 其他相关信息:Docker version 24.0.6 docker-compose version 1.25.0

Error Screenshots or Logs / 错误截图或日志

If possible, please provide relevant screenshots or logs of the error. / 如果可能,请提供相关的错误截图或日志文件。
image

Additional Notes / 其他备注

If you have any additional information or notes, please add them here. / 如果有其他补充信息,请在此处添加。

I sure the project is fetched to latest.
It seems that can't read variable in ".env" file also?

@Hanochhu Hanochhu added the bug Something isn't working label Oct 26, 2023
@sailaoda sailaoda reopened this Oct 26, 2023
@sailaoda
Copy link
Collaborator

Hello, thanks for your issue, you could fetch to latest project and try again, and run "docker-compose up" to see what is happening.

@sailaoda sailaoda added Await Response Waiting for the user to provide feedback(will closed in three days) and removed bug Something isn't working labels Oct 26, 2023
@Hanochhu
Copy link
Author

Hello, thanks for your issue, you could fetch to latest project and try again, and run "docker-compose up" to see what is happening.

it seems that something wrong because I use WSL but didn't use docker desktop? I use docker in WSL as other normal ubuntu system rather than install a docker desktop in windows.
And the variable in .env still don't work

image

@sailaoda sailaoda reopened this Oct 27, 2023
@sailaoda
Copy link
Collaborator

Hello, as your description, please check whether there is a Docker Desktop on your host Windows, if there is ,maybe it happened about the env problem.

If you don't have Docker Desktop installed on Windows and you're encountering the "docker-credential-desktop.exe not installed or not available in PATH" error when running docker-compose up in WSL, you should not be experiencing this issue since it is typically related to Docker Desktop.

If you are still encountering Docker-related issues in WSL, you can try the following steps to resolve the problem:

Ensure Docker is Properly Installed in WSL: First, make sure you have installed Docker within WSL. You can follow the official Docker documentation to install Docker to ensure the correct installation and configuration.

Restart WSL: Sometimes, restarting the WSL subsystem can resolve some Docker-related issues. You can restart WSL by running the following command in the Windows terminal:

wsl --shutdown

After that, try running Docker commands again.

Check Docker Configuration: Ensure that your Docker configuration is correct. You can check the configuration file for the Docker daemon, usually located at /etc/docker/daemon.json. Make sure there are no errors in the configuration and make corrections if necessary.

Check Docker Installation: Sometimes, Docker installation can go wrong, leading to Docker-related errors. Try reinstalling Docker and make sure you use the correct installation method.

If you're still facing issues, it's advisable to provide more error information or logs to better understand the root cause of the problem. This will make it easier to find a solution.

@Hanochhu
Copy link
Author

Hello, as your description, please check whether there is a Docker Desktop on your host Windows, if there is ,maybe it happened about the env problem.

If you don't have Docker Desktop installed on Windows and you're encountering the "docker-credential-desktop.exe not installed or not available in PATH" error when running docker-compose up in WSL, you should not be experiencing this issue since it is typically related to Docker Desktop.

If you are still encountering Docker-related issues in WSL, you can try the following steps to resolve the problem:

Ensure Docker is Properly Installed in WSL: First, make sure you have installed Docker within WSL. You can follow the official Docker documentation to install Docker to ensure the correct installation and configuration.

Restart WSL: Sometimes, restarting the WSL subsystem can resolve some Docker-related issues. You can restart WSL by running the following command in the Windows terminal:

wsl --shutdown

After that, try running Docker commands again.

Check Docker Configuration: Ensure that your Docker configuration is correct. You can check the configuration file for the Docker daemon, usually located at /etc/docker/daemon.json. Make sure there are no errors in the configuration and make corrections if necessary.

Check Docker Installation: Sometimes, Docker installation can go wrong, leading to Docker-related errors. Try reinstalling Docker and make sure you use the correct installation method.

If you're still facing issues, it's advisable to provide more error information or logs to better understand the root cause of the problem. This will make it easier to find a solution.

I fixed this issue by solution of https://stackoverflow.com/questions/67642620/docker-credential-desktop-not-installed-or-not-available-in-path

Thanks for your time! 👍

@Hanochhu
Copy link
Author

When you commit 8b17c43 which delete name: tool-server-network , I can run "docker-compose up" successfully but there is no "tool-server-network" container, hence this project doesn't work.

When you rollback in commit 6c04841, the issue in the very beginning shows again.
And I notice your commit message, it's something wrong with my docker version?

@Umpire2018 Umpire2018 reopened this Oct 28, 2023
@Umpire2018 Umpire2018 added help wanted Extra attention is needed and removed Await Response Waiting for the user to provide feedback(will closed in three days) labels Oct 28, 2023
@huruizhi
Copy link

docker-compose --env-file .env up -d

@88daxiong
Copy link

change the version to 3.7(the first line in docker-compose.yaml) will solve the problem "name was unexpected".

@Hanochhu
Copy link
Author

docker-compose --env-file .env up -d

👍 thank you

@Hanochhu
Copy link
Author

change the version to 3.7(the first line in docker-compose.yaml) will solve the problem "name was unexpected".

thank you . it's work

@Umpire2018
Copy link
Collaborator

  1. When using docker-compose up, Docker Compose will automatically look for a file named .env in the project directory and read the variables from there. @huruizhi
  2. We don't recommend changing base image version. @88daxiong

@Starfruit007
Copy link

I have encountered with same error, here is the details:

Error
networks.default value Additional properties are not allowed ('name' was unexpected)
volumes.toolserverconfig value Additional properties are not allowed ('name' was unexpected)
services.XAgentServer.depends_on contains an invalid type, it should be an array

Conclusion
I have installed an old version of docker-compose with command: apt-get install docker-compose

Problem Environment
Docker version 24.0.2
docker-compose version 1.17.1

Solution

sudo curl -L [https://github.com/docker/compose/releases/download/v2.21.0/docker-compose-uname](https://github.com/docker/compose/releases/download/v2.21.0/docker-compose-%60uname) -s-uname -m -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants