autok3s: [BUG] docker-compose - windows - Cannot connect to the Docker daemon at unix:///var/run/docker.sock

Describe the bug Not sure whether it is a missconfiguration or a bug

To reproduce Steps to reproduce the behavior:

  1. Create a docker-compose.yaml:
services:
  nginx-proxy:
    image: nginxproxy/nginx-proxy
    container_name: nginx-proxy
    ports:
      - "80:80"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
  autok3s:
    image: cnrancher/autok3s:v0.6.0
    init: true
    ports:
    - 8080
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - C:\\Users\\doublefx\\.autok3s\\:/home/.autok3s/
    environment:
    - AUTOK3S_CONFIG=/home/.autok3s/
    - VIRTUAL_HOST=autok3s.vcap.me
  1. run docker-compose -d up
  2. create a k3d cluster
  3. See an error: Cannot connect to the Docker daemon at unix:///var/run/docker.sock

image

OS: Windows 11 / Docker Desktop v4.13.1 (WSL2) AutoK3s Version: v0.6.0

About this issue

Most upvoted comments

I will try your steps on windows tomorrow, then give your feedback message.

Can your environment access the Internet? I try on my environment and the pods can be pulled down.

Unfortunately I think 0.6.0 is a failed version, it is recommended to use 0.5.2 to experience. Will release 0.6.1 ASAP.

I will support enviroment DOCKER_HOST feature as soon as possible to support this scenario.

Try this docker compose(which only running autok3s container with host port mapping), then access ui using http://127.0.0.1:<host mapping>:

services:
  autok3s:
    image: cnrancher/autok3s:v0.6.0
    init: true
    ports:
    - 8080
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - $HOME/.autok3s/:$HOME/.autok3s/
    environment:
    - AUTOK3S_CONFIG=$HOME/.autok3s/