DockerService

Description

The DockerService object is a SystemService which manages Docker containers. On instantiation it initializes all DockerObject objects attached to its containers and starts all enabled containers afterards.

› Inherits:SystemService

Properties

containers

This property holds a list of Docker containers to manage and start.

› Type:List<DockerContainer>
› Signal:containersChanged()
› Attributes:Readonly

error

This property holds the most recently occurred error or DockerContainer.NoError if no error occurred. If the same error occurs multiple times this property does not change. Use the errorOccurred() signal to detect multiple occurrences of the same error.

› Type:Error
› Signal:errorChanged()
› Attributes:Readonly

errorString

This property holds the current human readable error string corresponding to the current value in the error property. It may include additional information such as failure reasons or locations.

› Type:String
› Signal:errorStringChanged()
› Attributes:Readonly

password

This property holds the password used to login to the Docker registry.

This property was introduced in InCore 1.1.

› Type:String
› Signal:passwordChanged()
› Attributes:Writable

registry

This property holds the name of a registry, i.e. the server name, to login with username and password. See the official Docker documentation on docker login for details.

This property was introduced in InCore 1.1.

› Type:String
› Signal:registryChanged()
› Attributes:Writable

username

This property holds the username used to login to the Docker registry.

This property was introduced in InCore 1.1.

› Type:String
› Signal:usernameChanged()
› Attributes:Writable

Methods

login()

This method logs in to a Docker registry. This method is called on instantiation automatically and usually does not have to be called manually. It returns true if the login was successful. Otherwise false is returned and error is set to DockerService.LoginError.

This method was introduced in InCore 1.1.

› Returns:Boolean

logout()

This method logs out from a Docker registry.

This method was introduced in InCore 1.1.

Signals

containersDataChanged(SignedInteger index)

This signal is emitted whenever the List.dataChanged() signal is emitted, i.e. the item at index in the containers list itself emitted the dataChanged() signal.

errorOccurred()

This signal is emitted whenever an error has occurred, regardless of whether the error property has changed or not. In contrast to the change notification signal of the error property this signal is also emitted several times if a certain error occurs several times in succession.

Enumerations

Error

This enumeration describes all errors which can occur in DockerContainer objects. The most recently occurred error is stored in the error property.

Name Value Description
DockerService.NoError 0 No error occurred or was detected.
DockerService.LoginError 1 Docker registry login failed, likely due to invalid credentials.

Example

See DockerContainer example on how to use DockerService.