Documentation
¶
Index ¶
- func InstallOnCentos7(host, username, password string, port ...int) (result string, err error)
- func InstallOnCentos8(host, username, password string, port ...int) (result string, err error)
- type CRUD
- type Docker
- func (d *Docker) Connect()
- func (d *Docker) CreateContainerConsul(name string, port int, version string) (string, error)
- func (d *Docker) CreateContainerKafka(name, zookeeperName, host string, port int) (string, error)
- func (d *Docker) CreateContainerKafkaDefault() (string, error)
- func (d *Docker) CreateContainerMysql(name, version string, password string, port int) (string, error)
- func (d *Docker) CreateContainerPostgres(name, version string, password string, port int) (string, error)
- func (d *Docker) CreateContainerRedis(name string, port int, version string) (string, error)
- func (d *Docker) CreateContainerRedisDefault() (string, error)
- func (d *Docker) CreateContainerZookeeper(name string, port int) (string, error)
- func (d *Docker) CreateContainerZookeeperDefault() (string, error)
- func (d *Docker) Images() (string, error)
- func (d *Docker) IsDebug() bool
- func (d *Docker) Pull(name string) (string, error)
- func (d *Docker) PullVersion(name, version string) (string, error)
- func (d *Docker) Remove(name string) (string, error)
- func (d *Docker) SetDebug(debug bool)
- type DockerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallOnCentos7 ¶
在centos7上安装docker @param host: 主机地址 @param username: 用户名 @param password: 密码 @param port: 端口号,默认是200
Types ¶
type CRUD ¶
type CRUD interface {
Create(image, name, port []string, volume []string) // 创建容器
Delete() // 删除容器
Update() // 修改容器
Find() // 查询容器
Log() // 查询容器日志
}
容器的CRUD接口
type Docker ¶
type Docker struct {
// contains filtered or unexported fields
}
操作docker的结构体
func (*Docker) CreateContainerConsul ¶
创建consul容器
func (*Docker) CreateContainerKafka ¶
创建Zookeeper容器,默认使用zookeeper最新版本 @param name:容器名称 @param zookeeperName:zookeeper容器名称,kafka依赖于zookeeper @param host:kafka所在主机地址 @param port:kafka的端口号
func (*Docker) CreateContainerKafkaDefault ¶
按照默认的配置创建kafka
func (*Docker) CreateContainerMysql ¶
func (d *Docker) CreateContainerMysql(name, version string, password string, port int) (string, error)
创建Mysql容器 @param name:容器名称 @param version:Mysql镜像版本号 @param password:Mysql登录密码 @param port:容器端口号
func (*Docker) CreateContainerPostgres ¶
func (d *Docker) CreateContainerPostgres(name, version string, password string, port int) (string, error)
创建PostgreSQL容器 @param name:容器名称 @param version:PostgreSQL镜像版本号 @param password:PostgreSQL登录密码 @param port:容器端口号
func (*Docker) CreateContainerRedis ¶
创建Redis容器
func (*Docker) CreateContainerRedisDefault ¶
按照默认的配置创建Redis容器
func (*Docker) CreateContainerZookeeper ¶
创建Zookeeper容器,默认使用zookeeper最新版本 @param name:容器名称 @param port:容器端口号
func (*Docker) CreateContainerZookeeperDefault ¶
创建Zookeeper容器,默认使用zookeeper最新版本 容器名称默认使用zookeeper 端口号默认使用2181
func (*Docker) PullVersion ¶
拉取指定版本的镜像
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
z01_centos7_install_docker
command
|
|
|
z02_image_pull
command
|
|
|
z03_image_pull_version
command
|
|
|
z04_create_container_postgres
command
|
|
|
z05_create_container_mysql
command
|
|
|
z06_create_container_kafka
command
|
|
|
z06_remove_container
command
|
|
|
z07_create_container_redis
command
|
|
|
z08_create_container_consul
command
|