Closed
Description
Ask your question here
I'm setting up a local environment with docker-compose.yaml
dashboard:
image: "daprio/dashboard:0.8.0"
container_name: dapr_dashboard
init: true
network_mode: "host"
command: [ "-port", "8080"]
when run dapr with docker
docker-compose.yaml
ems-dapr:
image: "daprio/dapr:1.3.1"
container_name: ems_dapr
init: true
command: ["./daprd",
"--app-id", "ems",
"--log-level","debug",
"--app-port", "6060",
"--dapr-http-port","3000",
"--metrics-port","49090",
"--dapr-grpc-port", "40000",
"--config","/dapr/config.yaml"]
volumes:
- "/root/.dapr:/dapr"
depends_on:
- emsp-backend
network_mode: "host"
The configuration itself works fine, dashboard doesn't recognize dapr sidecar containers
i read the code ,found dashboard can't get applications when running in standalone with docker
// getStandaloneInstances returns the Dapr instances running in the standalone environment
import (
......
"github.com/dapr/cli/pkg/standalone"
......
)
......
func (i *instances) getStandaloneInstances(scope string) []Instance {
list := []Instance{}
output, err := standalone.List()
......
standalone.List() import from dapr cli "github.com/dapr/cli/pkg/standalone"
dapr cli project file: /pkg/standalone/list.go
when list all dapr applications
frist: filter sidecar process
// Populates the map if all data is available for the sidecar.
for _, proc := range processes {
executable := strings.ToLower(proc.Executable())
if (executable == "daprd") || (executable == "daprd.exe") {
procDetails, err := process.NewProcess(int32(proc.Pid()))
if err != nil {
continue
}
then: filter cli process
// The master list comes from cli processes, even if sidecar is not up.
for _, proc := range processes {
executable := strings.ToLower(proc.Executable())
if (executable == "dapr") || (executable == "dapr.exe") {
pID := proc.Pid()