docker

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultContainerEntrypoint = "/bin/sh"
	DefaultContainerCommand    = "echo Container started ; trap \"exit 0\" 15; while sleep 1 & wait $!; do :; done"
	DefaultContainerHostname   = "localpod"
)

Variables

View Source
var (
	ErrExistsButDifferent = fmt.Errorf("container exists, but does not match configuration")
)

Functions

func BuildImage added in v0.0.3

func BuildImage(cfg *config.DevContainer, env config.Env, stdout, stderr io.Writer) error

func HasDocker

func HasDocker() bool

Types

type Container

type Container struct {
	ID     string
	Name   string
	Config *config.DevContainer
}

func CreateContainer

func CreateContainer(name string, env config.Env, cfg *config.DevContainer, stdout, stderr io.Writer) (Container, error)

func (*Container) AddScript added in v0.0.3

func (c *Container) AddScript(name string, dstPath string, templatedContent string) error

func (*Container) Exec

func (c *Container) Exec(env config.Env, stdin io.Reader, stdout, stderr io.Writer) error

func (*Container) Exists

func (c *Container) Exists(name string) (string, error)

func (*Container) Rm added in v0.0.3

func (c *Container) Rm() error

func (*Container) RunCommand

func (c *Container) RunCommand(cmd []string) error

func (*Container) RunScript added in v0.0.3

func (c *Container) RunScript(cmd string, args ...string) error

func (*Container) Setup

func (c *Container) Setup() error

func (*Container) Start

func (c *Container) Start() error

func (*Container) Stop

func (c *Container) Stop() error

type TemplateScriptParams added in v0.0.3

type TemplateScriptParams struct {
	UID      string
	Username string
}

Jump to

Keyboard shortcuts

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