docker

package
v0.0.0-...-ebe581b Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const PADDLEFL_CONTAINER_IMAGE = "registry.baidubce.com/paddledtx/paddledtx-paddlefl:1.1.2"
View Source
const PADDLEFL_CONTAINER_WORKSPACE = "/workspace/%s/"
View Source
const PADDLEFL_LOCAL_WORKSPACE = "/home/paddlefl/%s/"

Variables

This section is empty.

Functions

func CheckRunningStatusByContainerName

func CheckRunningStatusByContainerName(name string) (bool, error)

CheckRunningStatusByContainerName use container's name to check whether the container is running

func CreateAndStartContainer

func CreateAndStartContainer(containerInfo *ContainerInfo) error

CreateAndStartContainer create and start a container

func RunCommand

func RunCommand(cmd []string, containerName string) error

Types

type ContainerInfo

type ContainerInfo struct {
	// image's name,  contains repository name and tag
	Image string
	// container's name
	Name string
	// commands executed one the container created
	Cmd []string
	// container's workspace
	WorkingDir string
	// ports mapping between physical machine and docker container, every string is equal to '-p' in 'docker run'
	Port []string
	// volumes mapping between physical machine and docker container, every string is equal to '-v' in 'docker run'
	Volume []string
}

ContainerInfo is the information required in creating a container, like the parameters of terminal command 'docker run'

Jump to

Keyboard shortcuts

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