Skip to content

Commit

Permalink
fix: add checkfor Docker requirements in Local Container Registry Sta…
Browse files Browse the repository at this point in the history
…rt (#902)

Signed-off-by: tarunrajput <[email protected]>
  • Loading branch information
tarunrajput authored Aug 9, 2024
1 parent dca3215 commit bcc4076
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/server/registry/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"net"
"os"
"os/exec"

"github.com/daytonaio/daytona/pkg/docker"
"github.com/docker/docker/api/types/container"
Expand Down Expand Up @@ -53,6 +54,14 @@ func (s *LocalContainerRegistry) Start() error {
return err
}

if _, err := exec.LookPath("docker"); err != nil {
return fmt.Errorf("cannot find Docker installation. Please install by following https://docs.docker.com/engine/install/ and try again")
}

if _, err := cli.Info(ctx); err != nil {
return fmt.Errorf("cannot connect to the Docker daemon. Is the Docker daemon running?")
}

dockerClient := docker.NewDockerClient(docker.DockerClientConfig{
ApiClient: cli,
})
Expand Down

0 comments on commit bcc4076

Please sign in to comment.