package docker
import "github.com/google/cadvisor/container/docker"
Provides global docker information.
Handler for Docker containers.
Index ¶
- Constants
- Variables
- func APIVersion() ([]int, error)
- func APIVersionString() (string, error)
- func Client() (*dclient.Client, error)
- func DetermineDeviceStorage(storageDriver StorageDriver, storageDir string, rwLayerID string) ( rootfsStorageDir string, zfsFilesystem string, zfsParent string, err error)
- func FsStats( stats *info.ContainerStats, machineInfoFactory info.MachineInfoFactory, metrics container.MetricSet, storageDriver StorageDriver, fsHandler common.FsHandler, globalFsInfo fs.FsInfo, poolName string, rootfsStorageDir string, zfsParent string, ) error
- func Images() ([]v1.DockerImage, error)
- func Info() (*dockersystem.Info, error)
- func NewPlugin() container.Plugin
- func ParseVersion(versionString string, regex *regexp.Regexp, length int) ([]int, error)
- func Register(factory info.MachineInfoFactory, fsInfo fs.FsInfo, includedMetrics container.MetricSet) error
- func RootDir() string
- func SetTimeout(timeout time.Duration)
- func StartThinPoolWatcher(dockerInfo *dockersystem.Info) (*devicemapper.ThinPoolWatcher, error)
- func StartZfsWatcher(dockerInfo *dockersystem.Info) (*zfs.ZfsWatcher, error)
- func Status() (v1.DockerStatus, error)
- func StatusFromDockerInfo(dockerInfo dockersystem.Info) (v1.DockerStatus, error)
- func StatusWithContext(ctx context.Context) (v1.DockerStatus, error)
- func ValidateInfo(GetInfo func() (*dockersystem.Info, error), ServerVersion func() (string, error)) (*dockersystem.Info, error)
- func VersionString() (string, error)
- type FsHandler
- type StorageDriver
Constants ¶
const DockerNamespace = "docker"
The namespace under which Docker aliases are unique.
Variables ¶
var ( VersionRe = regexp.MustCompile(versionRegexpString) )
Functions ¶
func APIVersion ¶
func APIVersionString ¶
func Client ¶
Client creates a Docker API client based on the given Docker flags
func DetermineDeviceStorage ¶
func DetermineDeviceStorage(storageDriver StorageDriver, storageDir string, rwLayerID string) ( rootfsStorageDir string, zfsFilesystem string, zfsParent string, err error)
func FsStats ¶
func FsStats( stats *info.ContainerStats, machineInfoFactory info.MachineInfoFactory, metrics container.MetricSet, storageDriver StorageDriver, fsHandler common.FsHandler, globalFsInfo fs.FsInfo, poolName string, rootfsStorageDir string, zfsParent string, ) error
func Images ¶
func Images() ([]v1.DockerImage, error)
func Info ¶
func Info() (*dockersystem.Info, error)
func NewPlugin ¶
NewPlugin returns an implementation of container.Plugin suitable for passing to container.RegisterPlugin()
func ParseVersion ¶
func Register ¶
func Register(factory info.MachineInfoFactory, fsInfo fs.FsInfo, includedMetrics container.MetricSet) error
Register root container before running this function!
func RootDir ¶
func RootDir() string
func SetTimeout ¶
func StartThinPoolWatcher ¶
func StartThinPoolWatcher(dockerInfo *dockersystem.Info) (*devicemapper.ThinPoolWatcher, error)
func StartZfsWatcher ¶
func StartZfsWatcher(dockerInfo *dockersystem.Info) (*zfs.ZfsWatcher, error)
func Status ¶
func Status() (v1.DockerStatus, error)
func StatusFromDockerInfo ¶
func StatusFromDockerInfo(dockerInfo dockersystem.Info) (v1.DockerStatus, error)
func StatusWithContext ¶
func StatusWithContext(ctx context.Context) (v1.DockerStatus, error)
func ValidateInfo ¶
func ValidateInfo(GetInfo func() (*dockersystem.Info, error), ServerVersion func() (string, error)) (*dockersystem.Info, error)
Checks whether the dockerInfo reflects a valid docker setup, and returns it if it does, or an error otherwise.
func VersionString ¶
Types ¶
type FsHandler ¶
type FsHandler struct { FsHandler common.FsHandler // thinPoolWatcher is the devicemapper thin pool watcher ThinPoolWatcher *devicemapper.ThinPoolWatcher // deviceID is the id of the container's fs device DeviceID string // zfsWatcher is the zfs filesystem watcher ZfsWatcher *zfs.ZfsWatcher // zfsFilesystem is the docker zfs filesystem ZfsFilesystem string }
FsHandler is a composite FsHandler implementation the incorporates the common fs handler, a devicemapper ThinPoolWatcher, and a zfsWatcher
func (*FsHandler) Start ¶
func (h *FsHandler) Start()
func (*FsHandler) Stop ¶
func (h *FsHandler) Stop()
func (*FsHandler) Usage ¶
type StorageDriver ¶
type StorageDriver string
const ( DevicemapperStorageDriver StorageDriver = "devicemapper" AufsStorageDriver StorageDriver = "aufs" OverlayStorageDriver StorageDriver = "overlay" Overlay2StorageDriver StorageDriver = "overlay2" ZfsStorageDriver StorageDriver = "zfs" VfsStorageDriver StorageDriver = "vfs" )
Source Files ¶
client.go docker.go factory.go fs.go handler.go plugin.go
Directories ¶
Path | Synopsis |
---|---|
container/docker/install | The install package registers docker.NewPlugin() as the "docker" container provider when imported |
container/docker/utils |
- Version
- v0.52.1 (latest)
- Published
- Mar 5, 2025
- Platform
- linux/amd64
- Imports
- 28 packages
- Last checked
- 3 days ago –
Tools for package owners.