# docker ```go import "github.com/Akilan1999/p2p-rendering-computation/server/docker" ``` ## Index - [func StopAndRemoveContainer\(containername string\) error](<#StopAndRemoveContainer>) - [type DockerContainer](<#DockerContainer>) - [type DockerContainers](<#DockerContainers>) - [func ViewAllContainers\(\) \(\*DockerContainers, error\)](<#ViewAllContainers>) - [type DockerVM](<#DockerVM>) - [func BuildRunContainer\(NumPorts int, GPU string, ContainerName string, baseImage string, publicKey string\) \(\*DockerVM, error\)](<#BuildRunContainer>) - [func \(d \*DockerVM\) CopyToTmpContainer\(\) error](<#DockerVM.CopyToTmpContainer>) - [func \(d \*DockerVM\) TemplateDockerContainer\(\) error](<#DockerVM.TemplateDockerContainer>) - [type ErrorDetail](<#ErrorDetail>) - [type ErrorLine](<#ErrorLine>) - [type Port](<#Port>) - [type Ports](<#Ports>) - [func OpenPortsFile\(filename string\) \(\*Ports, error\)](<#OpenPortsFile>) ## func [StopAndRemoveContainer]() ```go func StopAndRemoveContainer(containername string) error ``` StopAndRemoveContainer Stop and remove a container Reference \(https://gist.github.com/frikky/e2efcea6c733ea8d8d015b7fe8a91bf6\) ## type [DockerContainer]() ```go type DockerContainer struct { ContainerName string `json:"DockerContainerName"` ContainerDescription string `json:"ContainerDescription"` } ``` ## type [DockerContainers]() ```go type DockerContainers struct { DockerContainer []DockerContainer `json:"DockerContainer"` } ``` ### func [ViewAllContainers]() ```go func ViewAllContainers() (*DockerContainers, error) ``` ViewAllContainers returns all containers runnable and which can be built ## type [DockerVM]() ```go type DockerVM struct { SSHUsername string `json:"SSHUsername"` SSHPublcKey string `json:"SSHPublicKey"` ID string `json:"ID"` TagName string `json:"TagName"` ImagePath string `json:"ImagePath"` Ports Ports `json:"Ports"` GPU string `json:"GPU"` TempPath string BaseImage string LogsPath string SSHCommand string `json:"SSHCommand"` } ``` ### func [BuildRunContainer]() ```go func BuildRunContainer(NumPorts int, GPU string, ContainerName string, baseImage string, publicKey string) (*DockerVM, error) ``` BuildRunContainer Function is incharge to invoke building and running contianer and also allocating external ports ### func \(\*DockerVM\) [CopyToTmpContainer]() ```go func (d *DockerVM) CopyToTmpContainer() error ``` CopyToTmpContainer Creates a copy of the docker folder ### func \(\*DockerVM\) [TemplateDockerContainer]() ```go func (d *DockerVM) TemplateDockerContainer() error ``` TemplateDockerContainer This function templates the docker container with the base docker image to use ## type [ErrorDetail]() ```go type ErrorDetail struct { Message string `json:"message"` } ``` ## type [ErrorLine]() ```go type ErrorLine struct { Error string `json:"error"` ErrorDetail ErrorDetail `json:"errorDetail"` } ``` ## type [Port]() ```go type Port struct { PortName string `json:"PortName"` InternalPort int `json:"InternalPort"` Type string `json:"Type"` ExternalPort int `json:"ExternalPort"` IsUsed bool `json:"IsUsed"` Description string `json:"Description"` } ``` ## type [Ports]() ```go type Ports struct { PortSet []Port `json:"Port"` } ``` ### func [OpenPortsFile]() ```go func OpenPortsFile(filename string) (*Ports, error) ``` Generated by [gomarkdoc]()