Documentation ¶
Overview ¶
Package config contains everything necessary to build a config that can be later used for building a docker container from it
Index ¶
- func EnsureImage(controller *controller.Controller, imageName string) error
- type Builder
- func (b *Builder) Build() *Config
- func (b *Builder) CPUCount(CPUCount int) *Builder
- func (b *Builder) Cmd(cmd ...string) *Builder
- func (b *Builder) Image(image string) *Builder
- func (b *Builder) MemoryLimit(memoryLimit int) *Builder
- func (b *Builder) Mount(mount goboxMount.Mount) *Builder
- func (b *Builder) TimeLimit(timeLimit time.Duration) *Builder
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureImage ¶ added in v0.5.0
func EnsureImage(controller *controller.Controller, imageName string) error
EnsureImage pulls an image from the docker hub to make sure in exists
Types ¶
type Builder ¶
type Builder struct { Config *Config // contains filtered or unexported fields }
func NewConfigBuilder ¶
func NewConfigBuilder(controller *controller.Controller) *Builder
NewConfigBuilder return new builder that can be used to build config for a container
func (*Builder) CPUCount ¶
CPUCount sets max amount of CPU cycles for the container. Be aware that it might collide with TimeLimit since 1 CPU cycle is approximately 1 second.
func (*Builder) MemoryLimit ¶
MemoryLimit sets maximum amount of memory allocated to the container (in megabytes)
type Config ¶
type Config struct { //Fields related to docker API ContainerConfig container.Config HostConfig container.HostConfig NetworkingConfig network.NetworkingConfig Platform v1.Platform // Maximum allowed time for the container to run TimeLimit time.Duration }
Config contains fields necessary for creating a docker container
Click to show internal directories.
Click to hide internal directories.