フィルターのクリア

How do I install Docker on WSL2?

41 ビュー (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2022 年 7 月 12 日
編集済み: MathWorks Support Team 2023 年 4 月 19 日
I am trying to create microservice Docker images on a Windows machine. How do I install and use Docker using Windows Subsystem for Linux v2 (WSL2)?
 

採用された回答

MathWorks Support Team
MathWorks Support Team 2023 年 4 月 18 日
編集済み: MathWorks Support Team 2023 年 4 月 19 日
To use Docker with WSL2, you must first install WSL2 using the instructions on https://learn.microsoft.com/windows/wsl/install.
After installation, start a new WSL2 session and configure a non-root user account with sudo access, then complete the following steps. The instructions assume you are using an Ubuntu or Debian distribution. For other Linux distributions, see https://docs.docker.com/engine/install/.
Update software packages.
sudo apt update && sudo apt upgrade
Install Docker dependencies.
sudo apt install --no-install-recommends apt-transport-https ca-certificates curl gnupg2
Switch the firewall to legacy iptables.
update-alternatives --set iptables /usr/sbin/iptables-legacy
Download the Docker OpenPGP signing key for your distribution.
. /etc/os-release
curl -fsSL https://download.docker.com/linux/${ID}/gpg | gpg --dearmor \| sudo tee /usr/share/keyrings/docker-archive-keyring.gpg
Add the Docker package repository to /etc/apt/sources.list.d.
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \https://download.docker.com/linux/${ID} ${VERSION_CODENAME} stable" \
| sudo tee /etc/apt/sources.list.d/docker.list
Install Docker.
sudo apt update && sudo apt install docker-ce docker-ce-cli containerd.io
Add the current user to the docker group.
sudo usermod -aG docker $USER
Then, restart the WSL2 session and launch dockerd.
sudo dockerd
In a MATLAB command window, confirm that MATLAB detects your Docker installation.
[~,msg] = system('docker version')
  1 件のコメント
Jeremy Huard
Jeremy Huard 2022 年 11 月 23 日
@Mohamad The creation of microservices on Windows is only supported since R2022b. R2022a only supports Linux: https://www.mathworks.com/help/compiler_sdk/release-notes.html

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by