DockerNetwork

Description

The DockerNetwork object defines a Docker network used to connect Docker networks to each other. Most functionalities and modes (such as bridge, host and overlay networks) are supported through the DockerObject.driver and DockerObject.options properties. See the official Docker documentation for more information on how to use Docker networks.

› Inherits:

DockerObject

Overview

Properties

Methods

Signals

Enumerations

Properties

gateways

This property holds the gateways which to assign the Docker network.

This property was introduced in InCore 2.8.

› Type:

StringList

› Signal:

gatewaysChanged()

› Attributes:

Writable

internal

This property holds whether this network should be configured as an internal network used for connecting containers only. Internal networks can’t be accessed by the outside world.

› Type:

Boolean

› Default:

false

› Signal:

internalChanged()

› Attributes:

Writable

ipRange

This property holds the IP range which to allocate for the Docker network.

This property was introduced in InCore 2.8.

› Type:

String

› Signal:

ipRangeChanged()

› Attributes:

Writable

subnets

This property holds the subnets which to assign the Docker network.

This property was introduced in InCore 2.8.

› Type:

StringList

› Signal:

subnetsChanged()

› Attributes:

Writable

Example

import InCore.Foundation 2.5

Application {

    property var internalNetwork : DockerNetwork { id: internalNetwork; name: "example_internal"; internal: true; }

    DockerService {
        DockerContainer {
            name: "example-frontend"
            image: "example/frontend:latest"
            hostname: "frontend"
            ports: [ "80:80" ]
            networks: [ internalNetwork ]
        }
        DockerContainer {
            name: "example-backend"
            image: "example/backend:latest"
            hostname: "backend"
            networks: [ internalNetwork ]
        }
    }
}