Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please add multi docker-server environment setting #3551

Closed
Yensan opened this issue Jun 19, 2022 · 4 comments
Closed

please add multi docker-server environment setting #3551

Yensan opened this issue Jun 19, 2022 · 4 comments

Comments

@Yensan
Copy link

Yensan commented Jun 19, 2022

vs docker plugin is powerful. thank you

vs k8s plugin has multi server setting, it is very useful. It can check out and switch between multi cluster

    "vs-kubernetes": {
        "vs-kubernetes.knownKubeconfigs": [
            "/Users/XXX/.kube/config.suse",
            "/Users/XXX/.kube/config.local",
        ],
    },

Hope vs docker plugin have it some day.

@bwateratmsft
Copy link
Collaborator

Docker Contexts are probably what you are looking for. Let me know if that helps!

@Yensan
Copy link
Author

Yensan commented Jun 19, 2022

thx for reply
how ever, context is complex, set in settings.json is useful.
there is some case that .dockercontext can not handle. If use proxy, docker context will be failed. It can be set in vscode "docker.host": "tcp://some.com:57303",

@Yensan
Copy link
Author

Yensan commented Jun 19, 2022

docker context tool is buggy... I show you a bug.

I had an remote openSUSE host, it have docker, and minikube-KVM-docker, so it have two docker engine. don't be confused.

$ cat /etc/hosts | grep minikube # openSUSE host, have doker, and minikube-KVM-docker 
192.168.0.9     minikube

$ docker context ls

NAME                TYPE                DESCRIPTION                               DOCKER ENDPOINT               KUBERNETES ENDPOINT                    ORCHESTRATOR
default             moby                Current DOCKER_HOST based configuration   unix:///var/run/docker.sock   https://10.211.55.9:8443 (default)     swarm
suse                moby                                                          tcp://minikube:2375           https://192.168.39.88:8443 (default)   swarm
susemini *          moby                                                          tcp://minikube:57303          https://192.168.39.88:8443 (default)   swarm


$ docker context inspect susemini  # "SkipTLSVerify": false --will use tls/https

[
    {
        "Name": "susemini",
        "Metadata": {
            "StackOrchestrator": "swarm"
        },
        "Endpoints": {
            "docker": {
                "Host": "tcp://minikube:57303",
                "SkipTLSVerify": false
            },
            "kubernetes": {
                "Host": "https://192.168.39.88:8443",
                "SkipTLSVerify": false,
                "DefaultNamespace": "default"
            }
        },
        "TLSMaterial": {
            "kubernetes": [
                "ca.pem",
                "cert.pem",
                "key.pem"
            ]
        },
        "Storage": {
            "MetadataPath": "/Users/aChing/.docker/contexts/meta/60aab31ff14e42e859747ab71d1c7ab5ef342fbda0ad3b7a93d734111dfacabb",
            "TLSPath": "/Users/aChing/.docker/contexts/tls/60aab31ff14e42e859747ab71d1c7ab5ef342fbda0ad3b7a93d734111dfacabb"
        }
    }
]


$ docker ps -a  # well, it use http, then failed
>>> Error response from daemon: Client sent an HTTP request to an HTTPS server.

I don't want use docker context any more. By the way, it is not convenient at all.
VScode docker plugin is awesome. I put settings in settings.json, all things done!

// "docker.host":"unix:///var/run/docker.sock", //use native docker, uncomment it
// "docker.host": "tcp://192.168.0.9:2375",  // use openSUSE host's docker,uncomment it
 "docker.host": "tcp://minikube:57303",
 "docker.tlsVerify": "1",
 "docker.certPath": "/Users/XXX/.docker/susemini/",

@bwateratmsft
Copy link
Collaborator

bwateratmsft commented Jun 20, 2022

As far as I know, there isn't anything that can be done with DOCKER_HOST / docker.host that can't also be done with Docker contexts. The extension also already supports easily changing Docker contexts from either the command palette or the explorer view. There are some issues with the extension (e.g. #2058, #3263) but those will be fixed soon.

I know that contexts can be confusing to set up but I believe they are the solution you are looking for, as we already have built an experience around them to easily change between contexts.

@microsoft microsoft locked and limited conversation to collaborators Aug 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants