github.com/zhuohuang-hust/src-cbuild@v0.0.0-20230105071821-c7aab3e7c840/api/types/configs.go (about)

     1  package types
     2  
     3  import (
     4  	"github.com/docker/docker/api/types/container"
     5  	"github.com/docker/docker/api/types/network"
     6  )
     7  
     8  // configs holds structs used for internal communication between the
     9  // frontend (such as an http server) and the backend (such as the
    10  // docker daemon).
    11  
    12  // ContainerCreateConfig is the parameter set to ContainerCreate()
    13  type ContainerCreateConfig struct {
    14  	Name             string
    15  	Config           *container.Config
    16  	HostConfig       *container.HostConfig
    17  	NetworkingConfig *network.NetworkingConfig
    18  	AdjustCPUShares  bool
    19  }
    20  
    21  // ContainerRmConfig holds arguments for the container remove
    22  // operation. This struct is used to tell the backend what operations
    23  // to perform.
    24  type ContainerRmConfig struct {
    25  	ForceRemove, RemoveVolume, RemoveLink bool
    26  }
    27  
    28  // ContainerCommitConfig contains build configs for commit operation,
    29  // and is used when making a commit with the current state of the container.
    30  type ContainerCommitConfig struct {
    31  	Pause   bool
    32  	Repo    string
    33  	Tag     string
    34  	Author  string
    35  	Comment string
    36  	// merge container config into commit config before commit
    37  	MergeConfigs bool
    38  	Config       *container.Config
    39  }
    40  
    41  // ExecConfig is a small subset of the Config struct that holds the configuration
    42  // for the exec feature of docker.
    43  type ExecConfig struct {
    44  	User         string   // User that will run the command
    45  	Privileged   bool     // Is the container in privileged mode
    46  	Tty          bool     // Attach standard streams to a tty.
    47  	AttachStdin  bool     // Attach the standard input, makes possible user interaction
    48  	AttachStderr bool     // Attach the standard error
    49  	AttachStdout bool     // Attach the standard output
    50  	Detach       bool     // Execute in detach mode
    51  	DetachKeys   string   // Escape keys for detach
    52  	Env          []string // Environment variables
    53  	Cmd          []string // Execution commands and args
    54  }
    55  
    56  // PluginRmConfig holds arguments for the plugin remove
    57  // operation. This struct is used to tell the backend what operations
    58  // to perform.
    59  type PluginRmConfig struct {
    60  	ForceRemove bool
    61  }
    62  
    63  // PluginEnableConfig holds arguments for the plugin enable
    64  type PluginEnableConfig struct {
    65  	Timeout int
    66  }