docker

package
v0.0.0-...-32f9291 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

* Copyright 2020 The CCID Authors. * * 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.

* Copyright 2020 The CCID Authors. * * 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

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAndPushImage

func BuildAndPushImage(dockerfile string) (*chan string, error)

func CreateContainer

func CreateContainer(c *Model) (string, error)

func ExecContainer

func ExecContainer(c *Model, script string) (*chan string, error)

func PullImage

func PullImage(c *Model) (*chan string, error)

func RemoveContainer

func RemoveContainer(c *Model) error

func StartContainer

func StartContainer(c *Model) error

func StopContainer

func StopContainer(c *Model) error

Types

type CheckList

type CheckList struct {
	DockerEngineVersion string  //docker 版本
	IsAvailable         bool    //docker 是否可用
	FreeDiskSpace       float64 //存储位置的磁盘大小
	DiskSpaceUnit       string  //磁盘大小的单位
	ImageStorePath      string  //磁盘存储位置
	ContainerStorePath  string  //容器存储位置
}

func GetDockerEngineInfo

func GetDockerEngineInfo() (*CheckList, error)

获取docker相关信息

type Model

type Model struct {
	ID           string
	Image        string   // docker image name, format: image_name:tag
	Endpoint     string   // Image endpoint, such as: docker.com/nginx
	Env          []string //运行docker所需要的环境变量
	Cmd          []string //创建container时候需要传递的参数
	Options      string   //创建container时的可选参数
	Ports        []string //端口映射
	Volumes      []string //磁盘映射
	CodePath     string   //code path
	HostCodePath string   //host code path
}

Jump to

Keyboard shortcuts

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