Unbuntu WS2(Windows)で起動シェルが機能しません。

Unbuntu WS2(Windows)で起動シェルが機能しません。

私は最近、WSL2 Windowsで実行されているUbuntu18を使用しています。すべてのサービスをすばやく開始するためにシェルを作成しようとしていますが、エラーは常に存在します。

ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

私のシェルスクリプト(start.sh)は次のとおりです。

#!/bin/sh
service docker start
docker start <container_id>
echo "The container has been started"

その後実行

sudo ./start.sh

ベストアンサー1

おすすめ記事