Files
zeekayandHanzo Dev d697e8de8d Git Runner — GitHub-Actions-compatible CI runner for the Hanzo Git server
Native runner: module github.com/hanzo-git/runner, wire proto
github.com/hanzo-git/actions-proto-go, command git-runner, GIT_* env, git expr
context, git_* task-context keys, ghcr.io/hanzoai/runner-ubuntu job images.
Derived work — upstream attribution + MIT terms in NOTICE/LICENSE.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-13 11:46:09 -07:00

35 lines
628 B
Go

// Copyright 2023 The Git Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package envcheck
import (
"context"
"fmt"
"github.com/moby/moby/client"
)
func CheckIfDockerRunning(ctx context.Context, configDockerHost string) error {
opts := []client.Opt{
client.FromEnv,
}
if configDockerHost != "" {
opts = append(opts, client.WithHost(configDockerHost))
}
cli, err := client.New(opts...)
if err != nil {
return err
}
defer cli.Close()
_, err = cli.Ping(ctx, client.PingOptions{})
if err != nil {
return fmt.Errorf("cannot ping the docker daemon, is it running? %w", err)
}
return nil
}