docker

package
v0.0.0-...-1bf96ee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2022 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SockAddr = "/var/run/docker.sock"

连接列表

Functions

func StartContainer

func StartContainer(id string) error

启动容器

Types

type Container

type Container struct {
	Id              string                 `json:"Id"`
	Names           []string               `json:"Names"`
	Image           string                 `json:"Image"`
	ImageID         string                 `json:"ImageID"`
	Command         string                 `json:"Command"`
	Created         uint64                 `json:"Created"`
	State           string                 `json:"State"`
	Status          string                 `json:"Status"`
	Ports           []Port                 `json:"Ports"`
	Labels          map[string]string      `json:"Labels"`
	HostConfig      map[string]string      `json:"HostConfig"`
	NetworkSettings map[string]interface{} `json:"NetworkSettings"`
	Mounts          []Mount                `json:"Mounts"`
}

容器结构

func ReadContainer

func ReadContainer() ([]Container, error)

获取容器列表

type Image

type Image struct {
	Created     uint64
	Id          string
	ParentId    string
	RepoTags    []string
	Size        uint64
	VirtualSize uint64
}

镜像结构

func ReadImage

func ReadImage() ([]Image, error)

获取镜像列表

type Mount

type Mount struct {
	Type        string `json:"Type"`
	Source      string `json:"Source"`
	Destination string `json:"Destination"`
	Mode        string `json:"Mode"`
	RW          bool   `json:"RW"`
	Propatation string `json:"Propagation"`
}

docker 挂载

type Port

type Port struct {
	IP          string `json:"IP"`
	PrivatePort int    `json:"PrivatePort"`
	PublicPort  int    `json:"PublicPort"`
	Type        string `json:"Type"`
}

docker 端口映射

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL