containers

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RootUser    = "root"
	NonRootUser = "deploy"
)

Variables

View Source
var (

	// NonRootUserHomeDir defines the non root user's home directory
	NonRootUserHomeDir = "/home/" + NonRootUser
)

Functions

func RemoveContainerIfExistsByName

func RemoveContainerIfExistsByName(ctx context.Context, containerName string)

Types

type Container

type Container struct {
	Ctx context.Context

	ID   string
	Name string

	ImageReference string

	Stages []Stage

	Mounts map[string]string

	HostConfig container.HostConfig

	FilesToCopy []string

	Protected bool
	// contains filtered or unexported fields
}

func (*Container) AddPreStage

func (c *Container) AddPreStage(stage Stage)

func (*Container) Cleanup

func (c *Container) Cleanup()

func (*Container) Create

func (c *Container) Create() error

func (*Container) Protect

func (c *Container) Protect(ctx context.Context, cli *client.Client)

Protect removes shells from container to prevent attaching shell by user. Could find a better and more effective way to achieve this. Problem: User can still run basic commands (echo, ls, cat) using docker exec. Aim: Prevent any kind of interaction with docker container

func (*Container) Remove

func (c *Container) Remove() error

func (*Container) Start

func (c *Container) Start(ctx context.Context) error

func (*Container) Stop

func (c *Container) Stop() error

func (*Container) TailLogs

func (c *Container) TailLogs()

type Image

type Image struct {
	ID string

	Reference string
}

func BuildImage added in v0.0.7

func BuildImage(ctx context.Context, reference, dockerfile string) (*Image, error)

func SearchImage added in v0.0.7

func SearchImage(ctx context.Context, filterMap map[string]string) (*Image, error)

type Stage

type Stage struct {
	Privileged bool     `json:"privileged"`
	Command    []string `json:"command"`
	// contains filtered or unexported fields
}

func NewStage

func NewStage(command []string, privileged bool) *Stage

func (Stage) String

func (s Stage) String() string

Jump to

Keyboard shortcuts

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