0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[WIP] Dockerfile Tips

Last updated at Posted at 2021-11-20

Dockerfileのダウンロードからコンテナ作成までの流れ

  1. Docker Desktopのインストール
  2. Docker Desktopの起動
  3. Dockerfileのダウンロード
  4. Docker Imageの作成
  5. Docker Containerの作成

WSL上のUbuntuでdockerが使用できない

  • WSL上のUbuntuでdocker buildを実行した時、下記のようなエラーが排出される。
The command 'docker' could not be found in this WSL 1 distro. 
We recommend to convert this distro to WSL 2 and activate
the WSL integration in Docker Desktop settings.
  • このときは、記載の通りWSLのバージョンを1から2に上げる。
$ wsl --set-version Ubuntu 2
  • その後、さらに下記のようなエラーが排出される。
The command 'docker' could not be found in this WSL 2 distro.
We recommend to activate the WSL integration in Docker Desktop settings.

See https://docs.docker.com/docker-for-windows/wsl/ for details.
  • Docker Desktopを起動し、Settings > Resources > WSL INTEGRATIONでUbuntu(この画像ではUbuntu-18.04)をONにする。
    wsl2-choose-distro.png

  • 右下のApply & Restartを押下する。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?