docker

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const DBName = "lportal"

DBName name of the default database

View Source
const DBPassword = "my-secret-pw"

DBPassword default credentials for the database

View Source
const DBUser = "liferay"

DBUser default user for the database

Variables

This section is empty.

Functions

func CheckDocker

func CheckDocker() bool

CheckDocker checks if Docker is installed

func CheckDockerContainerExists

func CheckDockerContainerExists(containerName string) bool

CheckDockerContainerExists checks if the container is running

func CheckDockerImageExists

func CheckDockerImageExists(dockerImage string) bool

CheckDockerImageExists checks if the image is already present

func CopyFileToContainer

func CopyFileToContainer(image liferay.Image, path string) error

CopyFileToContainer copies a file to the running container

func GetAlias

func GetAlias() string

GetAlias returns the alias used to link containers

func GetDockerImageFromRunningContainer

func GetDockerImageFromRunningContainer(image liferay.Image) (string, error)

GetDockerImageFromRunningContainer gets the image name of the container

func GetDockerVersion

func GetDockerVersion() (string, types.Version, error)

GetDockerVersion returns the output of Docker version

func GetTomcatPort

func GetTomcatPort(image liferay.Image) string

GetTomcatPort gets Tomcat port from running instance

func LogContainer

func LogContainer(image liferay.Image)

LogContainer show logs of a container in tail mode

func PsFilterByLabel

func PsFilterByLabel(label string) ([]types.Container, error)

PsFilterByLabel Retrieves all containers with a label

func PullDockerImage

func PullDockerImage(dockerImage string)

PullDockerImage downloads the image

func RemoveDockerContainer

func RemoveDockerContainer(image liferay.Image) error

RemoveDockerContainer removes a running container, and its stack

func RemoveDockerImage

func RemoveDockerImage(dockerImageName string) error

RemoveDockerImage removes a docker image

func RunDatabaseDockerImage

func RunDatabaseDockerImage(image DatabaseImage) error

RunDatabaseDockerImage runs the image, setting the HTTP port and a volume for the data folder

func RunLiferayDockerImage

func RunLiferayDockerImage(
	image liferay.Image, database DatabaseImage, httpPort int, gogoShellPort int, enableDebug bool,
	debugPort int, memory string) error

RunLiferayDockerImage runs the image, setting the HTTP and GoGoShell ports for bundle, debug mode, and jvmMemory if needed

func StartDockerContainer

func StartDockerContainer(image liferay.Image) error

StartDockerContainer starts the stopped container

func StopDockerContainer

func StopDockerContainer(image liferay.Image) error

StopDockerContainer stops the running container

Types

type ContainerInstance

type ContainerInstance struct {
	ID     string `json:"id" binding:"required"`
	Name   string `json:"name" binding:"required"`
	Status string `json:"status" binding:"required"`
}

ContainerInstance simple model for a container

type DatabaseImage

type DatabaseImage interface {
	GetContainerName() string
	GetDataFolder() string
	GetEnvVariables() EnvVariables
	GetJDBCConnection() JDBCConnection
	GetFullyQualifiedName() string
	GetLpnType() string
	GetPort() int
	GetRepository() string
	GetTag() string
	GetType() string
}

DatabaseImage interface defining the contract for database docker images

func GetDatabase

func GetDatabase(image liferay.Image, datastore string) DatabaseImage

GetDatabase returns the proper database model

type EnvVariables

type EnvVariables struct {
	Password string
	Database string
	User     string
}

EnvVariables defines how to configure the internal variables for the database

type JDBCConnection

type JDBCConnection struct {
	DriverClassName string
	Password        string
	User            string
	URL             string
}

JDBCConnection defines the JDBC connection to the database

type MySQL

type MySQL struct {
	LpnType string
	Tag     string
}

MySQL represents a MySQL image

func (MySQL) GetContainerName

func (m MySQL) GetContainerName() string

GetContainerName returns the name of the container generated by this type of image

func (MySQL) GetDataFolder

func (m MySQL) GetDataFolder() string

GetDataFolder returns the data folder for the database

func (MySQL) GetEnvVariables

func (m MySQL) GetEnvVariables() EnvVariables

GetEnvVariables returns the specific environment variables to configure the docker image

func (MySQL) GetFullyQualifiedName

func (m MySQL) GetFullyQualifiedName() string

GetFullyQualifiedName returns the fully qualified name of the image

func (MySQL) GetJDBCConnection

func (m MySQL) GetJDBCConnection() JDBCConnection

GetJDBCConnection returns the JDBC connection

func (MySQL) GetLpnType

func (m MySQL) GetLpnType() string

GetLpnType returns the type of the lpn image

func (MySQL) GetPort

func (m MySQL) GetPort() int

GetPort returns the bind port of the service

func (MySQL) GetRepository

func (m MySQL) GetRepository() string

GetRepository returns the repository for MySQL

func (MySQL) GetTag

func (m MySQL) GetTag() string

GetTag returns the tag of the image

func (MySQL) GetType

func (m MySQL) GetType() string

GetType returns the type of the image

type PostgreSQL

type PostgreSQL struct {
	LpnType string
	Tag     string
}

PostgreSQL represents a PostgreSQL image

func (PostgreSQL) GetContainerName

func (p PostgreSQL) GetContainerName() string

GetContainerName returns the name of the container generated by this type of image

func (PostgreSQL) GetDataFolder

func (p PostgreSQL) GetDataFolder() string

GetDataFolder returns the data folder for the database

func (PostgreSQL) GetEnvVariables

func (p PostgreSQL) GetEnvVariables() EnvVariables

GetEnvVariables returns the specific environment variables to configure the docker image

func (PostgreSQL) GetFullyQualifiedName

func (p PostgreSQL) GetFullyQualifiedName() string

GetFullyQualifiedName returns the fully qualified name of the image

func (PostgreSQL) GetJDBCConnection

func (p PostgreSQL) GetJDBCConnection() JDBCConnection

GetJDBCConnection returns the JDBC connection

func (PostgreSQL) GetLpnType

func (p PostgreSQL) GetLpnType() string

GetLpnType returns the type of the lpn image

func (PostgreSQL) GetPort

func (p PostgreSQL) GetPort() int

GetPort returns the bind port of the service

func (PostgreSQL) GetRepository

func (p PostgreSQL) GetRepository() string

GetRepository returns the repository for PostgreSQL

func (PostgreSQL) GetTag

func (p PostgreSQL) GetTag() string

GetTag returns the tag of the image

func (PostgreSQL) GetType

func (p PostgreSQL) GetType() string

GetType returns the type of the image

Jump to

Keyboard shortcuts

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