<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>Sixeight</author_name>
  <author_url>https://blog.hatena.ne.jp/Sixeight/</author_url>
  <blog_title>ちなみに</blog_title>
  <blog_url>https://blog.nishimu.land/</blog_url>
  <categories>
    <anon>技術</anon>
  </categories>
  <description>docker-composeで特定サービスのコンテナIDを得たいことがある。例えば docker attach したいときとか。 これまでなら以下のように書くと web サービスだけのIDが取得できた。 $ docker-compose ps -q web しかし、新しい Docker Compose CLI では ps サブコマンドでサービスの絞り込みが出来ないのでちょっと工夫が必要。 $ docker compose ps --format json | jq -r '.[] | select(.Service == &quot;web&quot;) | .ID' 突然 jq が出てきてちょっとびっくりしそう…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.nishimu.land%2Fentry%2F2021%2F06%2F09%2F003936&quot; title=&quot;新しいdocker composeで特定サービスのコンテナIDを得る - ちなみに&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>2021-06-09 00:39:36</published>
  <title>新しいdocker composeで特定サービスのコンテナIDを得る</title>
  <type>rich</type>
  <url>https://blog.nishimu.land/entry/2021/06/09/003936</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
