Documentation ¶
Overview ¶
Copyright 2020 PhysarumSM Development Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- func BuildImage(buildContext io.Reader, image string) error
- func CheckContainerHealth(cont string) (float64, float64, error)
- func CreateEncodedAuth(username, password string) (string, error)
- func DeleteContainer(cont string) (string, error)
- func ListImages() ([]string, error)
- func ListRunningContainers() ([]string, error)
- func PullImage(image string) (digest string, err error)
- func PushImage(encodedAuth, image string) (digest string, err error)
- func ResizeContainer(cont string, mem int64, cpu float64) (string, error)
- func RestartContainer(cont string) (string, error)
- func RunContainer(opt DockerConfig) (string, error)
- func SaveImage(image string) ([]byte, error)
- func StopContainer(cont string) (string, error)
- type DockerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildImage ¶
Builds an image given a build context and image name buildContext is a tar archive containing all files needed to build image, including Dockerfile
func CheckContainerHealth ¶
calculate container cpu and mem usage
func CreateEncodedAuth ¶
Creates a base64-encoded registry auth configuration Used when pushing an image Supply this function's output as an argument to PushImage() More info: https://docs.docker.com/engine/api/v1.40/#section/Authentication
func ListImages ¶
func ListRunningContainers ¶
func ResizeContainer ¶
resizing a container instance on the fly
func RunContainer ¶
func RunContainer(opt DockerConfig) (string, error)
create and run container - interactive and detached set image (already pulled) should be imagename:version default/empty cmd is /bin/bash