Documentation ¶
Overview ¶
Package docker contains the functions necessary to start or discover a Telepresence daemon running in a docker container.
Index ¶
- Constants
- Variables
- func BuildImage(ctx context.Context, context string, buildArgs []string) (string, error)
- func ClientImage(ctx context.Context) string
- func ConnectDaemon(ctx context.Context, address string) (conn *grpc.ClientConn, err error)
- func ContainerIP(ctx context.Context, name string) (string, error)
- func DaemonArgs(daemonID *daemon.Identifier, port int) []string
- func DaemonOptions(ctx context.Context, daemonID *daemon.Identifier) ([]string, *net.TCPAddr, error)
- func EnableClient(ctx context.Context) context.Context
- func EnsureNetwork(ctx context.Context, name string) error
- func EnsureVolumePlugin(ctx context.Context) (string, error)
- func GetClient(ctx context.Context) (*client.Client, error)
- func LaunchDaemon(ctx context.Context, daemonID *daemon.Identifier) (conn *grpc.ClientConn, err error)
- func PullImage(ctx context.Context, image string) error
- func StartVolumeMounts(ctx context.Context, pluginName, dcName, container string, sftpPort int32, ...) ([]string, error)
- func StopContainer(ctx context.Context, nameOrID string) error
- func StopVolumeMounts(ctx context.Context, vols []string)
Constants ¶
const (
TpCache = "/root/.cache/telepresence"
)
Variables ¶
var ClientImageName = telepresenceImage //nolint:gochecknoglobals // extension point
Functions ¶
func BuildImage ¶
BuildImage builds an image from source. Stdout is silenced during those operations. The image ID is returned.
func ClientImage ¶
ClientImage returns the fully qualified name of the docker image that corresponds to the version of the current executable.
func ConnectDaemon ¶
ConnectDaemon connects to a containerized daemon at the given address.
func ContainerIP ¶ added in v2.14.0
ContainerIP returns the IP assigned to the container with the given name on the telepresence network.
func DaemonArgs ¶
func DaemonArgs(daemonID *daemon.Identifier, 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, daemonID *daemon.Identifier) ([]string, *net.TCPAddr, error)
DaemonOptions returns the options necessary to pass to a docker run when starting a daemon container.
func EnsureNetwork ¶
EnsureNetwork checks if a network with the given name exists, and creates it if that is not the case.
func EnsureVolumePlugin ¶ added in v2.13.0
EnsureVolumePlugin checks if the telemount plugin is installed and installs it if that is not the case. The plugin is also enabled.
func LaunchDaemon ¶
func LaunchDaemon(ctx context.Context, daemonID *daemon.Identifier) (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.Info entry in the cache.
func PullImage ¶
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.
func StartVolumeMounts ¶ added in v2.13.0
func StopContainer ¶ added in v2.13.0
func StopVolumeMounts ¶ added in v2.13.0
Types ¶
This section is empty.