Skip to content

Interface: IDockerConnectionOptions ​

The connection options of the Docker component, as buildDockerConnectionOptions takes them: a socket (socketPath), or a host and port reached over HTTP, HTTPS or SSH. Without socketPath nor host, the component connects to the Docker of the environment (DOCKER_HOST, else the local socket), with the other options given (timeout, headers, version…) applied over the environment's.

Properties ​

ca? ​

optional ca?: string | string[] | Buffer<ArrayBufferLike> | Buffer<ArrayBufferLike>[]

The certificates of the authorities trusted for the daemon's HTTPS certificate: their PEM contents, not their file paths.

Default ​

ts
undefined (the authorities of Node.js)

cert? ​

optional cert?: string | string[] | Buffer<ArrayBufferLike> | Buffer<ArrayBufferLike>[]

The client certificate of the HTTPS connections (its PEM contents).

Default ​

ts
undefined

headers? ​

optional headers?: object

The HTTP headers added to every request sent to the daemon.

Index Signature ​

[name: string]: string

Default ​

ts
undefined

host? ​

optional host?: string

The host name or IP address of the daemon, reached with protocol.

Default ​

ts
undefined (the Docker of the environment)

key? ​

optional key?: string | string[] | Buffer<ArrayBufferLike> | Buffer<ArrayBufferLike>[] | IDockerKeyObject[]

The private key of cert (its PEM contents), or keys with their passphrases.

Default ​

ts
undefined

port? ​

optional port?: string | number

The port of the daemon on host: by convention 2375 over HTTP and 2376 over HTTPS; the SSH port for 'ssh'.

Default ​

ts
undefined (80 over HTTP, 443 over HTTPS, 22 over SSH)

protocol? ​

optional protocol?: "https" | "http" | "ssh"

How host is reached: 'http', 'https', or 'ssh' (which needs the optional package ssh2, and the Docker CLI on the remote host). Ignored with socketPath.

Default ​

'https' when ca, cert and key are all given, 'http' otherwise


socketPath? ​

optional socketPath?: string

The path of the daemon's Unix socket (/var/run/docker.sock), or of its named pipe on Windows (//./pipe/docker_engine). When set, host and port are ignored.

Default ​

ts
undefined (the Docker of the environment)

sshAuthAgent? ​

optional sshAuthAgent?: string

The path of the SSH agent's socket, which authenticates the SSH connections.

Default ​

undefined (the SSH_AUTH_SOCK environment variable)


timeout? ​

optional timeout?: number

How long a request may stay idle (no data received), in milliseconds, before it fails; the streams (followed logs) included.

Default ​

ts
undefined (no timeout)

username? ​

optional username?: string

The user of the SSH connections.

Default ​

ts
undefined

version? ​

optional version?: string

The version of the Docker Engine API used by the requests ('1.47' or 'v1.47').

Default ​

ts
undefined (negotiated with the daemon)

Released under the MIT License.