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

DOCKER_HOST environment variable not honored #3970

Closed
jpenalbae opened this issue Jun 13, 2023 · 1 comment
Closed

DOCKER_HOST environment variable not honored #3970

jpenalbae opened this issue Jun 13, 2023 · 1 comment

Comments

@jpenalbae
Copy link

jpenalbae commented Jun 13, 2023

Versions

Version: 1.80.0-insider
Commit: 79c4092768e41b16fd823e80c874dbfafdc08f55
Date: 2023-06-13T05:22:36.374Z
Electron: 22.5.5
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Linux x64 6.1.0-9-amd64

Docker extension: 1.25.0

Problem

The latest docker extension version 1.25.0 seems to be ignoring the DOCKER_HOST environment variable.

I have the following settings in my User/settings.json:

    "docker.dockerPath": "/usr/bin/podman",
    "docker.composeCommand": "/usr/bin/docker-compose",
    "dev.containers.dockerComposePath": "/usr/bin/docker-compose",
    "dev.containers.dockerPath": "/usr/bin/podman",
    "docker.environment": {
        "DOCKER_HOST": "unix:///run/user/1000/podman/podman.sock"
    }

Using socat to "sniff" the unix socket traffic:

$ sudo socat -t100 -x -v UNIX-LISTEN:/run/user/1000/podman/podman.sock,mode=777,reuseaddr,fork UNIX-CONNECT:/run/user/1000/podman/podman2.sock

After resetting vscode or reloading the window there is no traffic on the unix socket, and docker extension says it cannot connect:

docker

Going back to version 1.22.0

If I roll back to version 1.22.0 everything seems to be working fine:

$ sudo socat -t100 -x -v UNIX-LISTEN:/run/user/1000/podman/podman.sock,mode=777,reuseaddr,fork UNIX-CONNECT:/run/user/1000/podman/podman2.sock
--
> 2023/06/13 16:48:15.000630805  length=78 from=0 to=77
 47 45 54 20 2f 63 6f 6e 74 61 69 6e 65 72 73 2f  GET /containers/
 6a 73 6f 6e 3f 61 6c 6c 3d 74 72 75 65 20 48 54  json?all=true HT
 54 50 2f 31 2e 31 0d 0a                          TP/1.1..
 48 6f 73 74 3a 20 6c 6f 63 61 6c 68 6f 73 74 0d  Host: localhost.
 0a                                               .
 43 6f 6e 6e 65 63 74 69 6f 6e 3a 20 63 6c 6f 73  Connection: clos
 65 0d 0a                                         e..
 0d 0a                                            ..
--
> 2023/06/13 16:48:15.000632434  length=114 from=0 to=113
 47 45 54 20 2f 69 6d 61 67 65 73 2f 6a 73 6f 6e  GET /images/json
 3f 66 69 6c 74 65 72 73 3d 25 37 42 25 32 32 64  ?filters=%7B%22d
 61 6e 67 6c 69 6e 67 25 32 32 25 33 41 25 35 42  angling%22%3A%5B
 25 32 32 66 61 6c 73 65 25 32 32 25 35 44 25 37  %22false%22%5D%7
 44 20 48 54 54 50 2f 31 2e 31 0d 0a              D HTTP/1.1..
 48 6f 73 74 3a 20 6c 6f 63 61 6c 68 6f 73 74 0d  Host: localhost.
 0a                                               .
 43 6f 6e 6e 65 63 74 69 6f 6e 3a 20 63 6c 6f 73  Connection: clos
 65 0d 0a                                         e..
 0d 0a                                            ..
--

docker2

Extra notes

Settings the environment variables within the shell instead of on settings.json doesn't work either.

@bwateratmsft
Copy link
Collaborator

Beginning with version 1.23.0 we switched to exclusively using the CLI to communicate with Docker, instead of the HTTP daemon. The Podman CLI is different enough that it is no longer compatible. You can track the status in #3241. I will resolve this issue as a dupe of that.

Your best bet as a workaround is to just use 1.22.0.

@bwateratmsft bwateratmsft closed this as not planned Won't fix, can't repro, duplicate, stale Jun 13, 2023
@microsoft microsoft locked and limited conversation to collaborators Jul 29, 2023
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