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?

Invalid argumentでdockerの起動ができない際の設定の見直し

Posted at

「体験しながら学ぶ ネットワーク技術入門」を元に、
WSL上にUbuntu, Dockerを構築していた際に生じたエラー

==================================
Checking WSL configuration...
==================================
Hostname is UBUNTU
Docker service is not running
Logged in as 'root'

どうやらdockerが起動していないらしい
(本には詳しいことが描いていなかった)

なのでsudoコマンドでdockerの起動を試みるも、そちらもエラーに↓

sudo service docker start
/etc/init.d/docker: 62: ulimit: error setting limit (Invalid argument) Problem

調べていく中でこちらのサイトを発見↓

windowsのエクスプローラーでネットワークを開き、アドレスに「\wsl$」と入力
ファイル「Ubuntu-20.04/etc/init.d/docker」をメモ帳か何かで開き、62行目「ulimit -Hn 524288」とある以下の部分を編集

# Only set the hard limit (soft limit should remain as the system default of 1024):
ulimit -Hn 524288

引数「-H」を削除し、 「ulimit -n 524288」に変更しれば動くとのこと。
実際消したら動きました!やったね

おわりに

どうやらdockerのバージョンによって上記の制限設定が追加されたとのことです。
(つまり前のバージョンだと平気らしい)
環境構築が一番難しいですね。。

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?