dapr / dashboard

General purpose dashboard for Dapr
Apache License 2.0
181 stars 47 forks source link

Project name must not be empty when running in docker compose #259

Open sclarke81 opened 1 year ago

sclarke81 commented 1 year ago

I'm trying to add Dapr Dashboard to my docker compose file, but I'm getting the following output and the dashboard homepage says "No Dapr applications are currently running. Check out this documentation page to get started."

true
/home/nonroot/dapr/components
/home/nonroot/dapr/config.yml
/home/nonroot/docker-compose.yml
Dapr Dashboard running on http://localhost:8080
2023/07/27 17:56:24 project name must not be empty

I have the following in my docker compose file:

  dapr-dashboard:
    image: "daprio/dashboard:latest"
    command: [ "--docker-compose=true",
      "--components-path=/home/nonroot/dapr/components",
      "--config-path=/home/nonroot/dapr/config.yml",
      "--docker-compose-path=/home/nonroot/docker-compose.yml" ]
    ports:
      - "8080:8080"
    volumes:
      - "./dapr:/home/nonroot/dapr"
      - ./docker-compose.yml:/home/nonroot/docker-compose.yml
    networks:
      - dapr-network

I've tried looking for the source of the error but I'm coming up empty. Any advice on where I'm going wrong would be greatly appreciated.

timcallaghan commented 12 months ago

Hi @sclarke81

I have just tested this today and for me it's working correctly.

When I first wrote the code to add docker compose support there was a bug that got merged to master that produced the project name must not be empty. This meant that at some point earlier this year there was a version of the dashboard Docker image that contained this bug. The fix for this bug was included in this PR https://github.com/dapr/dashboard/pull/252 and has been merged since mid-July 2023.

What I suspect is happening here is that because you're using image: "daprio/dashboard:latest" your docker engine has already pulled and cached the latest tag and your local environment won't update that image unless you re-pull the latest image (this tricked me up a few times when I first started using Docker). Essentially latest does not mean "every time I run this go and get me the latest image and use that". What it means is "hey do I have an image locally with tag called latest? If I do use that cached image forever more, if I don't go out and get it". So even though it looks like you're using the latest version of the dashboard, I suspect you are using an historical cached version that contains the bug.

To fix this, you simply need to pull down the latest version of the dashboard image. You can do so by running docker pull daprio/dashboard:latest.

For what it's worth - I tend to not reference the latest tag in my docker compose files because it can lead to situations like above. Instead, I reference the explicitly tagged image and when I decide I want to upgrade the version of the image I do so deliberately by adjusting it in the docker compose file. This strategy has worked well for me other the years 👍

P.S. The tests I did today to confirm this was working are located here https://github.com/timcallaghan/dapr-dotnet-example