bug: Wrong choice of docker context
hwdef opened this issue · 6 comments
Are you use the envd server?
- Yes, I am using the envd server.
- No, I am not using the envd server.
Describe the bug
When I installed envd, I encountered the following error during bootstrap. I think it does not accurately identify the docker context
❯ envd bootstrap
INFO[2023-02-27T10:41:52+08:00] [1/3] Bootstrap SSH Key
INFO[2023-02-27T10:41:52+08:00] [2/3] Bootstrap autocomplete
INFO[2023-02-27T10:41:52+08:00] Install zsh autocompletion
INFO[2023-02-27T10:41:52+08:00] You may have to restart your shell for autocomplete to get initialized (e.g. run "exec $SHELL")
INFO[2023-02-27T10:41:52+08:00] [3/3] Bootstrap buildkit
error: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
❯ docker context list
NAME DESCRIPTION DOCKER ENDPOINT ERROR
default Current DOCKER_HOST based configuration unix:///var/run/docker.sock
lima-docker * unix:///Users/edward/.lima/docker/sock/docker.sock
To Reproduce
envd bootstrap
Expected behavior
Choose the docker context correctly
The docker info
output
Client:
Context: lima-docker
Debug Mode: false
Server:
Containers: 1
Running: 0
Paused: 0
Stopped: 1
Images: 2
Server Version: 23.0.1
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: false
userxattr: true
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 31aa4358a36870b21a992d3ad2bef29e1d693bec
runc version: v1.1.4-0-g5fd4c4d
init version: de40ad0
Security Options:
seccomp
Profile: builtin
rootless
cgroupns
Kernel Version: 5.15.0-60-generic
Operating System: Ubuntu 22.04.1 LTS
OSType: linux
Architecture: aarch64
CPUs: 4
Total Memory: 3.816GiB
Name: lima-docker
ID: c45f58ae-8b70-434f-9686-0dcfdab4ac1c
Docker Root Dir: /home/edward.linux/.local/share/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
The envd version
output
envd: v0.3.13
BuildDate: 2023-02-20T01:48:25Z
GitCommit: 0.3.13-Homebrew
GitTreeState: clean
GitTag: v0.3.13
GoVersion: go1.19.6
Compiler: gc
Platform: darwin/arm64
Additional context
No response
I think currently we get the value from DOCKER_HOST, could you please check what DOCKER_HOST is in your environment?
DOCKER_HOST is null
It seems you are using colima currently.
I'm not sure whether the link will be helpful for you.
or you can exec export DOCKER_HOST="unix:///Users/edward/.lima/docker/sock/docker.sock"
in your terminal which you want to exec envd
command
I think this will solve my problem, but I want envd to auto use my default docker context.
Not sure if this is related, but after running
❯ docker system prune -a -f --volumes
❯ pip install --upgrade envd
❯ envd boostrap
INFO[2023-07-28T08:55:15-06:00] [1/5] Bootstrap SSH Key
INFO[2023-07-28T08:55:15-06:00] [2/5] Bootstrap registry CA keypair
INFO[2023-07-28T08:55:15-06:00] [3/5] Bootstrap registry json config
INFO[2023-07-28T08:55:15-06:00] [4/5] Bootstrap autocomplete
INFO[2023-07-28T08:55:15-06:00] Install zsh autocompletion
INFO[2023-07-28T08:55:15-06:00] You may have to restart your shell for autocomplete to get initialized (e.g. run "exec $SHELL")
INFO[2023-07-28T08:55:15-06:00] [5/5] Bootstrap buildkit
error: timeout 5s: cannot connect to buildkitd
Turns out it is related and I was on the wrong context.
❯ envd context ls
CONTEXT BUILDER BUILDER ADDR RUNNER RUNNER ADDR
default docker-container docker-container://envd_buildkitd docker
flyte-sandbox (current) tcp tcp://localhost:30003 docker
Changing to default and envd bootstrap
works.