5
Go to list of users who liked
3
Windows上のwslでdocker compose upを実行するとThe command 'docker' could not be found in this WSL 2 distroと出る[docker desktopをWSLと統合する方法]
Last updated atPosted at 2024-12-21
windowsのwsl上でdocker compose up
を実行するとこのような結果になりませんか?
windowsusername:~/test$ docker compose upThe command 'docker' could not be found in this WSL 2 distro.We recommend to activate the WSL integration in Docker Desktop settings.For details about using Docker Desktop with WSL 2, visit:https://docs.docker.com/go/wsl2/
これはたいてい2パターンの原因が考えられます.本記事ではwindows上にインストールされたdocker desktopをWSLと統合する方法について紹介します.
docker compose upが実行できない理由
- Windows側でDocker Desktopが起動していない
- Docker Desktopの設定でWSL integrationが有効化されていない
- 以前のDocker EngineやCLIのインストールとの競合の可能性
- WSLのバージョンが1.1.3.0未満の可能性
- Docker Desktopが正しくインストールされていない可能性
と色々原因は考えられるが今回は太字の部分のみ解説します.
そのほかはDocker Desktopを再起動したり,バージョンアップや再インストールすればいいので...
Docker Desktopの設定でWSL integrationが有効化されていない
結論GUI操作のみでいけます.数クリックするのみです.
右上の歯車(setting)→Resources→ WSL Integretion →対象のWSLディストリビューションのトグルボタンをOnにする → Docker Desktopを再起動
それではQiitaアドカレ.24企画の今日のクリスマスツリーです.
詳しくはこちらの記事から
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme