10
5

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 5 years have passed since last update.

Dockerで構築したUbuntu18.04でip系のコマンドが実行できない場合の対処

Posted at

Dockerで起動したUbuntuでrootユーザーであるにも関わらず、ip系コマンドを入力して、以下のように実行できない場合。。。

root@d7a6f6a495dd:/# ip netns add helloworld
mount --make-shared /var/run/netns failed: Operation not permitted

docker runのオプションである--privilegedを付与すると権限が与えられる

docker run --privileged -it -d --name ubuntu-test ubuntu:18.04

これでOK

root@d7a6f6a495dd:/# ip netns add helloworld
root@d7a6f6a495dd:/# ip netns list
helloworld
10
5
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
10
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?