acelink icon indicating copy to clipboard operation
acelink copied to clipboard

Ace Link does not respect docker contexts

Open florius0 opened this issue 6 months ago • 1 comments

RN docker socket is hardcoded:

https://github.com/blaise-io/acelink/blob/0291aff7f28823b431be8a1b0a0ca2538f9be592/Ace%20Link/Extensions/Process.swift#L21

Which may work for some docker runtimes, tho is not guaranteed to work in the future, or with the default one.

Much better solution would be to fetch the socket URI from user's docker configuration using docker context inspect:

[
    {
        "Name": "orbstack",
        "Metadata": {
            "Description": "OrbStack"
        },
        "Endpoints": {
            "docker": {
                "Host": "unix:///Users/.../.orbstack/run/docker.sock",
                "SkipTLSVerify": false
            }
        },
        "TLSMaterial": {},
        "Storage": {
            "MetadataPath": "/Users/.../.docker/contexts/meta/2d89b732b01a00a2d1675ed3cee9fd0f965daadf90603c989dd3afd4569c6896",
            "TLSPath": "/Users/.../.docker/contexts/tls/2d89b732b01a00a2d1675ed3cee9fd0f965daadf90603c989dd3afd4569c6896"
        }
    }
]

The URI is at [0]Endpoints.docker.host.

Related issues

Solving the problem in the described way will also likely solve the following issues:

  • #76
  • #73
  • #72
  • #69

Temporary Workaround

At the moment, one could symlink socket of runtime of their choice to ~/.docker/run/docker.sock, i.e. ln -s /Users/.../.orbstack/run/docker.sock ~/.docker/run/docker.sock.

PS I request @blaise-io to pin the issue until fix is implemented, as it contains workaround

florius0 avatar Dec 30 '23 18:12 florius0