Skip to content

Variable: buildDockerConnectionOptions ​

const buildDockerConnectionOptions: ComponentOptionsBuilder<IDockerConnectionOptions>

Build the component options of a Docker connected as the options say, to register it in the components of an application under the name of your choice. Without socketPath nor host, it connects to the Docker of the environment (DOCKER_HOST, else the local socket). The options are validated when the component is created, not here.

Param ​

options

The connection options: a socket (socketPath), or a host and port reached with protocol ('http', 'https' or 'ssh'), with their TLS, SSH, timeout and API version options.

Returns ​

The component options ({class: Docker, ...options}).

Example ​

typescript
import {Application} from 'lakutata'
import {buildDockerConnectionOptions} from 'lakutata/com/docker'

Application.run(() => ({
    id: 'docker.app',
    name: 'Docker',
    components: {
        //The Docker of the environment (DOCKER_HOST, else the local socket), with the API version 1.47
        docker: buildDockerConnectionOptions({version: '1.47'})
    }
}))

Released under the MIT License.