config.go 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package container
  2. import (
  3. "github.com/docker/docker/api/types/strslice"
  4. "github.com/docker/go-connections/nat"
  5. )
  6. // Config contains the configuration data about a container.
  7. // It should hold only portable information about the container.
  8. // Here, "portable" means "independent from the host we are running on".
  9. // Non-portable information *should* appear in HostConfig.
  10. // All fields added to this struct must be marked `omitempty` to keep getting
  11. // predictable hashes from the old `v1Compatibility` configuration.
  12. type Config struct {
  13. Hostname string // Hostname
  14. Domainname string // Domainname
  15. User string // User that will run the command(s) inside the container
  16. AttachStdin bool // Attach the standard input, makes possible user interaction
  17. AttachStdout bool // Attach the standard output
  18. AttachStderr bool // Attach the standard error
  19. ExposedPorts map[nat.Port]struct{} `json:",omitempty"` // List of exposed ports
  20. PublishService string `json:",omitempty"` // Name of the network service exposed by the container
  21. Tty bool // Attach standard streams to a tty, including stdin if it is not closed.
  22. OpenStdin bool // Open stdin
  23. StdinOnce bool // If true, close stdin after the 1 attached client disconnects.
  24. Env []string // List of environment variable to set in the container
  25. Cmd *strslice.StrSlice // Command to run when starting the container
  26. ArgsEscaped bool `json:",omitempty"` // True if command is already escaped (Windows specific)
  27. Image string // Name of the image as it was passed by the operator (eg. could be symbolic)
  28. Volumes map[string]struct{} // List of volumes (mounts) used for the container
  29. WorkingDir string // Current directory (PWD) in the command will be launched
  30. Entrypoint *strslice.StrSlice // Entrypoint to run when starting the container
  31. NetworkDisabled bool `json:",omitempty"` // Is network disabled
  32. MacAddress string `json:",omitempty"` // Mac Address of the container
  33. OnBuild []string // ONBUILD metadata that were defined on the image Dockerfile
  34. Labels map[string]string // List of labels set to this container
  35. StopSignal string `json:",omitempty"` // Signal to stop a container
  36. }