Skip to content

Feature: Add support for Docker Contexts #6

@Radiergummi

Description

@Radiergummi

A Docker Context allows to manage different Docker Engine connections, and easily connect to them, e.g.:

$ docker context create local --docker host=tcp://docker:2375
$ docker context create remote --docker host=ssh://user@host:22

$ docker context use remote

This is currently not working with the deployment action as we both shell out to docker CLI commands (which use the context) and directly connect to the Docker API (in which case we don't know about the context).
We could improve here by inspecting the current context:

$ docker context inspect
[
    {
        "Name": "default",
        "Metadata": {},
        "Endpoints": {
            "docker": {
                "Host": "unix:///var/run/docker.sock",
                "SkipTLSVerify": false
            }
        },
        "TLSMaterial": {},
        "Storage": {
            "MetadataPath": "\u003cIN MEMORY\u003e",
            "TLSPath": "\u003cIN MEMORY\u003e"
        }
    }
]

By parsing the output and applying it to the Docker environment variables, we should be able to add native context support. Requires a bit of research however, especially in terms of key material for TLS or SSH connections.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions