writeDockerKey

writeDockerKey $secretName $directory

Write Docker TLS credentials correctly based on a fixed secret format.

Example secrets.json:

{
  "default-docker": {
    "kind": "Secret",
    "data": {
      "clientCertificate": "-----BEGIN CERTIFICATE-----\nMI[...]",
      "clientKey": "-----BEGIN RSA PRIVATE KEY-----\nMI[...]",
      "CACertificate": "-----BEGIN CERTIFICATE-----\nMI[...]"
    }
  }
}

Parameters

$secretName

Optional

The name of the secret to read. Must match the attribute name of a secretsMap entry.

Default: docker.

$directory

Optional

Where to write the key and certificates.

Default: ~/.docker; the Docker client’s default location.