docker

package
v2.12.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package docker contains the functions necessary to start or discover a Telepresence daemon running in a docker container.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientImage

func ClientImage(ctx context.Context) string

ClientImage returns the fully qualified name of the docker image that corresponds to the version of the current executable.

func ConnectDaemon

func ConnectDaemon(ctx context.Context, address string) (conn *grpc.ClientConn, err error)

ConnectDaemon connects to a daemon at the given address.

func DaemonArgs

func DaemonArgs(name string, port int) []string

DaemonArgs returns the arguments to pass to a docker run when starting a container daemon.

func DaemonOptions

func DaemonOptions(ctx context.Context, name string) ([]string, *net.TCPAddr, error)

DaemonOptions returns the options necessary to pass to a docker run when starting a daemon container.

func DiscoverDaemon

func DiscoverDaemon(ctx context.Context, name string) (conn *grpc.ClientConn, err error)

DiscoverDaemon searches the daemon cache for an entry corresponding to the given name. A connection to that daemon is returned if such an entry is found.

func EnableK8SAuthenticator

func EnableK8SAuthenticator(ctx context.Context) error

func EnsureNetwork

func EnsureNetwork(ctx context.Context, name string)

EnsureNetwork checks if that a network with the given name exists, and creates it if that is not the case.

func LaunchDaemon

func LaunchDaemon(ctx context.Context, name string) (conn *grpc.ClientConn, err error)

LaunchDaemon ensures that the image returned by ClientImage exists by calling PullImage. It then uses the options DaemonOptions and DaemonArgs to start the image, and finally ConnectDaemon to connect to it. A successful start yields a cache.DaemonInfo entry in the cache.

func PullImage

func PullImage(ctx context.Context, image string) error

PullImage checks if the given image exists locally by doing docker image inspect. A docker pull is performed if no local image is found. Stdout is silenced during those operations.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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