<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>progrunner17</author_name>
  <author_url>https://blog.hatena.ne.jp/progrunner17/</author_url>
  <blog_title>Re Inventing the Wheel.</blog_title>
  <blog_url>https://progrunner.hatenablog.jp/</blog_url>
  <categories>
    <anon>Docker</anon>
    <anon>Linux</anon>
    <anon>ネットワーク</anon>
  </categories>
  <description>まず、あらかじめ入りたいコンテナのIDか名前を取得しておき、以下の様な手順で入れる。 pid=$(docker inspect &lt;コンテナのIDか名前&gt; --format '{{.State.Pid}}') sudo mkdir -p /var/run/netns sudo mount --bind /proc/${pid}/ns/net /var/run/netns/&lt;名前（任意)&gt; sudo ip netns exec &lt;名前&gt; bash 基本的にホストのソフトをそのまま使えるので、ipやping等をそのまま使えて便利。 ただし、自分でunmountし無い限り、docker上でコンテナを消…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fprogrunner.hatenablog.jp%2Fentry%2F2020%2F05%2F14%2F202053&quot; title=&quot;起動済みのdockerコンテナのネットワーク名前空間に入る方法 - Re Inventing the Wheel.&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-05-14 20:20:53</published>
  <title>起動済みのdockerコンテナのネットワーク名前空間に入る方法</title>
  <type>rich</type>
  <url>https://progrunner.hatenablog.jp/entry/2020/05/14/202053</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
