Skip to content

Add configuration for docker command and refreshing time #24

@luixal

Description

@luixal

Hi!

I've been using this extension for some time now, great work!

I'm thinking about monitoring remote docker containers. It could be easilly done if you could tweak the docker command or just add a prefix so you can run the command through ssh.

In example, taking the getContainers function, instead of having:

const psOut = await execCommand(["docker", "ps", "-a", "--format", "{{.Names}},{{.Status}}"]);

have something like this:

const psOut = await execCommand([`${COMMAND_PREFIX} docker`, "ps", "-a", "--format", "{{.Names}},{{.Status}}"]);

where COMMAND_PREFIX comes from preferences. If nothing is set, everything keeps working local but if you set it to something like ssh myuser@my-remote-host the extension will be running the command on a different machine through ssh. I'm asuming ssh keys configured, but if security is not an issue you can use something like sshpass -pMyNotSoGreatPassword ssh myuser@my-remote-host. It would be really useful.

Also, once including preferences, the 2 seconds refreshing time can be too much in some cases, would be great to make it configurable.

What do you think about these changes?

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions