<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kakts</author_name>
  <author_url>https://blog.hatena.ne.jp/kakts/</author_url>
  <blog_title>kakts-log</blog_title>
  <blog_url>https://kakts.dev/</blog_url>
  <categories>
    <anon>docker</anon>
  </categories>
  <description>docker run時にコンテナ内の特定のポートに、host上のランダムなポートをbindさせる方法をまとめます。 簡単なwebサーバの実装とDockerコンテナ用のDockerfileの記述 今回、下記のような構成で簡単なwebサーバを作るとする。 $ tree . ├── Dockerfile # webサーバ用コンテナのDockerfile └── app └── identidock.py # Flask webサーバの実装 今回は本筋でないので説明しませんが、pythonのwebフレームワークであるFlaskを使って、localhost の/に対してhttpリクエストしたときに He…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkakts.dev%2Fentry%2F2017%2F05%2F30%2F000049&quot; title=&quot;docker run時にホスト上のランダムなポートにコンテナを割り当てる - kakts-log&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>2017-05-30 00:00:49</published>
  <title>docker run時にホスト上のランダムなポートにコンテナを割り当てる</title>
  <type>rich</type>
  <url>https://kakts.dev/entry/2017/05/30/000049</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
