container

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package container contains the logic for creating and entering containers.

Index

Constants

This section is empty.

Variables

View Source
var DontAttachEnter = false

DontAttachEnter is a flag that tells the enter command to not attach to the container (for the enter command)

View Source
var DontStopOnFinish = false

DontStopOnFinish prevents the container from stopping after the create commands are ran

View Source
var PkgVersion = "latest"

PkgVersion specifies the version of develbox (inside the container)

Functions

func Contains added in v0.6.0

func Contains(list []string, item string) bool

Contains loops through a list to check if a string is inside it

func ContainsString added in v0.6.0

func ContainsString(list []string, item string) bool

ContainsString loops through a list to check if a string contains an item

func Create

func Create(cfg config.Structure, deleteOld bool) error

Create creates a container and runs the setupContainer function

func Enter

func Enter(cfg config.Structure, root bool) error

Enter runs a shell in the container and creates a pipe for package installations.

func FileExists

func FileExists(path string) bool

FileExists checks if a file/path exists using os.Stat()

func GetFolderFiles

func GetFolderFiles(path string) ([]string, error)

GetFolderFiles reads all the names in the a path, and returns them

func GetFolderFilesMtch added in v0.1.0

func GetFolderFilesMtch(path string, match string) ([]string, error)

GetFolderFilesMtch returns a list of all the files inside a path that match a string

func InstallAndEnter added in v0.4.0

func InstallAndEnter(cfg config.Structure, root bool) error

InstallAndEnter install the packages and runs a shell in the container

func MountArg added in v0.5.9

func MountArg(list []string, mount string, readOnly bool, bindPropagation string) []string

MountArg appends a string to a list with the mount argument. It also checks path existance and replaces any environment variables

func ReplaceEnvVars added in v0.4.0

func ReplaceEnvVars(str string) string

ReplaceEnvVars matches any text that starts with "$" and replaces it with the value of the environment variable. If not set, it will return an empty string.

func RunCommandList

func RunCommandList(name string, commands []string, pman *podman.Podman, root bool, attach podman.Attach) error

RunCommandList loops through the commands list and runs each one separately

Types

This section is empty.

Jump to

Keyboard shortcuts

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