Documentation
¶
Index ¶
- Variables
- func ArgsMatchRunning(ctx context.Context, runningData types.ContainerJSON, runArgs []string) bool
- func CreateAppInst(ctx context.Context, accessApi platform.AccessApi, client ssh.Client, ...) error
- func CreateAppInstLocal(ctx context.Context, client ssh.Client, app *edgeproto.App, ...) error
- func DeleteAppInst(ctx context.Context, accessApi platform.AccessApi, client ssh.Client, ...) error
- func DockerImagePresent(ctx context.Context, client ssh.Client, image string) (bool, error)
- func GetAppInstRuntime(ctx context.Context, client ssh.Client, app *edgeproto.App, ...) (*edgeproto.AppInstRuntime, error)
- func GetContainerCommand(clusterInst *edgeproto.ClusterInst, app *edgeproto.App, ...) (string, error)
- func GetContainerName(appInst *edgeproto.AppInst) string
- func GetDockerPortString(ports []dme.AppPort, containerPortType string, ...) []string
- func SeedDockerSecret(ctx context.Context, client ssh.Client, imagePath string, ...) error
- func UpdateAppInst(ctx context.Context, accessApi platform.AccessApi, client ssh.Client, ...) error
- type DockerNetworkingMode
- type DockerOptions
- type DockerReqOp
Constants ¶
This section is empty.
Variables ¶
var EnvoyProxy = "envoy"
var NginxProxy = "nginx"
var SingleOpts = map[string]struct{}{
"-d": {},
"--detach": {},
"--disable-content-trust": {},
"--help": {},
"--init": {},
"-i": {},
"--interactive": {},
"--no-healthcheck": {},
"--oom-kill-disable": {},
"--privileged": {},
"-P": {},
"--publish-all": {},
"--read-only": {},
"--rm": {},
"--sig-proxy": {},
"-t": {},
"--tty": {},
}
SingleOpts are docker run options that take no option value.
var UseInternalPortInContainer = "internalPort"
var UsePublicPortInContainer = "publicPort"
Functions ¶
func ArgsMatchRunning ¶
Attempt to see if running container matches the desired run state from the args. On updates, this is used to decide if the container needs to be stopped and started to apply new run args. Note: ports are not checked because we use host network mode, and so ports are never specified.
func CreateAppInst ¶
func CreateAppInstLocal ¶
func CreateAppInstLocal(ctx context.Context, client ssh.Client, app *edgeproto.App, appInst *edgeproto.AppInst) error
Local Docker AppInst create is different due to fact that MacOS doesn't like '--network=host' option. Instead on MacOS docker needs to have port mapping explicity specified with '-p' option. As a result we have a separate function specifically for a docker app creation on a MacOS laptop TODO: Replace this with CreateAppInst with WithExportPorts() and WithNoHostNetwork() options.
func DeleteAppInst ¶
func DockerImagePresent ¶
func GetAppInstRuntime ¶
func GetContainerCommand ¶
func GetContainerCommand(clusterInst *edgeproto.ClusterInst, app *edgeproto.App, appInst *edgeproto.AppInst, req *edgeproto.ExecRequest) (string, error)
func GetContainerName ¶
func GetDockerPortString ¶
func GetDockerPortString(ports []dme.AppPort, containerPortType string, proxyMatch, listenIP, listenIPV6 string) []string
Helper function that generates the ports string for docker command Example : "-p 80:80/http -p 7777:7777/tcp"
func SeedDockerSecret ¶
func SeedDockerSecret(ctx context.Context, client ssh.Client, imagePath string, authAPI cloudcommon.RegistryAuthApi) error
Types ¶
type DockerNetworkingMode ¶
type DockerNetworkingMode string
var DockerBridgeMode DockerNetworkingMode = "bridgeMode"
var DockerHostMode DockerNetworkingMode = "hostMode"
type DockerOptions ¶
type DockerReqOp ¶
type DockerReqOp func(do *DockerOptions) error
func WithExposePorts ¶
func WithExposePorts() DockerReqOp
func WithForceImagePull ¶
func WithForceImagePull(force bool) DockerReqOp
func WithNoHostNetwork ¶
func WithNoHostNetwork() DockerReqOp
func WithStopTimeoutSecs ¶
func WithStopTimeoutSecs(timeoutSecs int) DockerReqOp