docker / for-win

Bug reports for Docker Desktop for Windows
https://www.docker.com/products/docker#/windows
1.86k stars 292 forks source link

Docker fail to retrieve OCI runtime (youki) #13836

Open peter-jerry-ye opened 11 months ago

peter-jerry-ye commented 11 months ago

Description

I'd like to use youki as runtime. I followed the instruction on the docker doc, installed youki and configured json file. However, when I run it, it fails to retrieve the OCI runtime with the following error

docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: unable to retrieve OCI runtime error (open /var/run/desktop-containerd/daemon/io.containerd.runtime.v2.task/moby/d1b564df3d8ac53db23972e89d8e514d64e1d7470c74c81170e876691553b273/log.json: no such file or directory): fork/exec /home/zihang/moon/youki/youki: no such file or directory: unknown.

and /var/run/desktop-containerd does not exist

Reproduce

  1. Build youki and configure JSON file so that youki is in the runtime list
  2. Run docker run --rm --runtime youki hello-world

Expected behavior

Docker executes as if running with runc

docker version

Client: Docker Engine - Community
 Cloud integration: v1.0.35+desktop.5
 Version:           24.0.7
 API version:       1.43
 Go version:        go1.20.10
 Git commit:        afdd53b
 Built:             Thu Oct 26 09:08:02 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Desktop
 Engine:
  Version:          master
  API version:      1.44 (minimum version 1.12)
  Go version:       go1.21.3
  Git commit:       54fcd40aa4de94cd75aedc5f6ebf38c6d8f92082
  Built:            Wed Nov 22 07:42:49 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.25
  GitCommit:        d8f198a4ed8892c764191ef7b3b06d8a2eeb5c7f
 runc:
  Version:          1.1.10
  GitCommit:        v1.1.10-0-g18a0cb0
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client: Docker Engine - Community
 Version:    24.0.7
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.0-desktop.2
    Path:     /usr/local/lib/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.23.3-desktop.2
    Path:     /usr/local/lib/docker/cli-plugins/docker-compose
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     /usr/local/lib/docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.21
    Path:     /usr/local/lib/docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  0.1
    Path:     /usr/local/lib/docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v0.1.0-beta.10
    Path:     /usr/local/lib/docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /usr/local/lib/docker/cli-plugins/docker-sbom
  scan: Docker Scan (Docker Inc.)
    Version:  v0.26.0
    Path:     /usr/local/lib/docker/cli-plugins/docker-scan
  scout: Docker Scout (Docker Inc.)
    Version:  v1.2.0
    Path:     /usr/local/lib/docker/cli-plugins/docker-scout

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 1
 Server Version: master
 Storage Driver: stargz
  driver-type: io.containerd.snapshotter.v1
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 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: youki io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: d8f198a4ed8892c764191ef7b3b06d8a2eeb5c7f
 runc version: v1.1.10-0-g18a0cb0
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
 Kernel Version: 5.15.133.1-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 9.716GiB
 Name: docker-desktop
 ID: 840b1c32-8af6-425e-9886-a6f3bac3d48f
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Registry Mirrors:
  https://docker.mirrors.sjtug.sjtu.edu.cn/
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
WARNING: daemon is not using the default seccomp profile

Diagnostics ID

7FBE6D48-34BA-48DC-B18A-B6A24A286650/20231209140657

Additional Info

No response

nicks commented 11 months ago

This doc is for configuring youki on docker engine on Linux - https://docs.docker.com/engine/alternative-runtimes/#youki

In your docker info output, you're connecting to docker desktop. Docker desktop manages its own Linux VM where it runs docker engine, so the engine won't be able to find the youki binaries you downloaded.

Here's a doc on how to set up wasm on docker desktop, maybe that will help? https://docs.docker.com/desktop/wasm/

peter-jerry-ye commented 11 months ago

Hello,

Thank you for your response. I'd like to customize a docker runtime for wasm to provide more host functions other than the standard wasi.

So is it possible to use a customized shim (like a io.containerd.wasmtime.v1 but compiled by myself) with Docker Desktop? Or other runtimes such as crun / youki? Or should I use a VM instead?

Thank you.


发件人: Nick Santos @.> 发送时间: 2023年12月10日 2:01 收件人: docker/for-win @.> 抄送: Zihang Ye @.>; Author @.> 主题: Re: [docker/for-win] Docker fail to retrieve OCI runtime (youki) (Issue #13836)

This doc is for configuring youki on docker engine on Linux - https://docs.docker.com/engine/alternative-runtimes/#youki

In your docker info output, you're connecting to docker desktop. Docker desktop manages its own Linux VM where it runs docker engine, so the engine won't be able to find the youki binaries you downloaded.

Here's a doc on how to set up wasm on docker desktop, maybe that will help? https://docs.docker.com/desktop/wasm/

― Reply to this email directly, view it on GitHubhttps://github.com/docker/for-win/issues/13836#issuecomment-1848601062, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD7U6XOANLCKVWFTLBVDJ3DYISRPZAVCNFSM6AAAAABAN2IFZGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBYGYYDCMBWGI. You are receiving this because you authored the thread.Message ID: @.***>

sam-thibault commented 11 months ago

This tool may help with what you want to do: https://github.com/jprendes/docker-desktop-shim-manager You can look at the scripts in that repo, but it will help put your shim where it needs be located for Docker Desktop to find it. The usage would be something like: dd-shim-mngr install IMAGE

peter-jerry-ye commented 11 months ago

Thank you for your help. I'll check that.


发件人: Sam Thibault @.> 发送时间: 2023年12月12日 18:10 收件人: docker/for-win @.> 抄送: Zihang Ye @.>; Author @.> 主题: Re: [docker/for-win] Docker fail to retrieve OCI runtime (youki) (Issue #13836)

This tool may help with what you want to do: https://github.com/jprendes/docker-desktop-shim-manager You can look at the scripts in that repo, but it will help put your shim where it needs be located for Docker Desktop to find it. The usage would be something like: dd-shim-mngr install IMAGE

― Reply to this email directly, view it on GitHubhttps://github.com/docker/for-win/issues/13836#issuecomment-1851730593, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD7U6XMU6NWZAAX2GA5OV6TYJAUTFAVCNFSM6AAAAABAN2IFZGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJRG4ZTANJZGM. You are receiving this because you authored the thread.Message ID: @.***>