<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Docker &#8211; 開発記録</title>
	<atom:link href="https://www.kthksgy.com/category/docker/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.kthksgy.com</link>
	<description>開発メモです。現在レイアウトが一部崩れている箇所があります。</description>
	<lastBuildDate>Sat, 05 Feb 2022 20:14:32 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.3</generator>
	<item>
		<title>Dockerイメージを一括でタグごとに最新にアップデートする</title>
		<link>https://www.kthksgy.com/docker/pull-all/</link>
					<comments>https://www.kthksgy.com/docker/pull-all/#respond</comments>
		
		<dc:creator><![CDATA[kthksgy]]></dc:creator>
		<pubDate>Sat, 05 Feb 2022 20:14:32 +0000</pubDate>
				<category><![CDATA[Docker]]></category>
		<guid isPermaLink="false">https://www.kthksgy.com/?p=44</guid>

					<description><![CDATA[タグごとに、pullしているDockerイメージを最新にアップデートします。 使用ユーザーはdockerグループに入っている前提なので、入っていない場合はdockerコマンドの前にsudoを付けてください。 $ dock&#8230;]]></description>
										<content:encoded><![CDATA[<p>タグごとに、pullしているDockerイメージを最新にアップデートします。</p>
<p>使用ユーザーは<code>docker</code>グループに入っている前提なので、入っていない場合は<code>docker</code>コマンドの前に<code>sudo</code>を付けてください。</p>
<pre><code>$ docker images --format "{{.Repository}}:{{.Tag}}" | sed "/&lt;none&gt;$/d" | xargs -P0 -L1 docker pull
</code></pre>
<p>ググって見つかったワンライナーでも一括更新できたのですが、私の環境だと<code>latest</code>は要らなかったのでタグごとに<code>pull</code>するワンライナーを作りました。</p>
<p>一括で全部のイメージを更新したいけど、<code>latest</code>は別に要らないんだよなって人向けです。</p>
<h2>解説</h2>
<p>ざっくり解説します。</p>
<ul>
<li><code>docker images --format "{{.Repository}}:{{.Tag}}"</code><br />
Dockerイメージの一覧を<code>イメージ名:タグ名</code>の形式で出力します。</li>
<li><code>sed "/&lt;none&gt;$/d"</code><br />
タグが<code>&lt;none&gt;</code>のイメージ(いわゆる<a class="wp-editor-md-post-content-link" href="https://docs.docker.jp/config/pruning.html">宙ぶらりんイメージ</a>)を出力から取り除きます。<br />
このコマンドは無くても後続の<code>docker pull</code>がエラーで弾くので、不要と言えば不要です。</li>
<li><code>xargs -P0 -L1 docker pull</code><br />
それぞれのイメージを<code>pull</code>します。</li>
</ul>
<h2>検証環境</h2>
<p>今回、検証した環境です。</p>
<pre><code>$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"
$ docker -v
Docker version 20.10.12, build e91ed57
$ docker-compose -v
docker-compose version 1.29.2, build 5becea4c
</code></pre>
<h2>参考</h2>
<ul>
<li><a class="wp-editor-md-post-content-link" href="https://qiita.com/suin/items/5d65320ee9fb9596249f">一括してDockerイメージを最新にアップデートしたい &#8211; Qiita</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.kthksgy.com/docker/pull-all/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SpeedtestのDockerイメージを作った</title>
		<link>https://www.kthksgy.com/docker/docker-speedtest/</link>
					<comments>https://www.kthksgy.com/docker/docker-speedtest/#respond</comments>
		
		<dc:creator><![CDATA[kthksgy]]></dc:creator>
		<pubDate>Tue, 21 Apr 2020 23:12:55 +0000</pubDate>
				<category><![CDATA[Docker]]></category>
		<category><![CDATA[Dockerイメージ]]></category>
		<guid isPermaLink="false">https://www.kthksgy.com/?p=4</guid>

					<description><![CDATA[Linuxで回線速度を測る時に使用するSpeedtestを使いたい時がたまにあります。 初期セットアップ時に導入していつでも使えるようにした所でそんなに使わない、かといって使いたい時が全く無いわけでは無い……。 なので測&#8230;]]></description>
										<content:encoded><![CDATA[<p>Linuxで回線速度を測る時に使用する<a class="wp-editor-md-post-content-link" href="https://www.speedtest.net/">Speedtest</a>を使いたい時がたまにあります。</p>
<p>初期セットアップ時に導入していつでも使えるようにした所でそんなに使わない、かといって使いたい時が全く無いわけでは無い……。</p>
<p>なので測りたい時だけ導入して終わったら無かった事に出来るように、Dockerイメージを作成しました。</p>
<h2>実行</h2>
<p><code>docker run --rm kthksgy/speedtest:latest</code>を実行してください。</p>
<p>初回のみイメージのダウンロードが行われます。</p>
<pre><code class="language-shell line-numbers">$ docker run --rm kthksgy/speedtest:latest
==============================================================================

You may only use this Speedtest software and information generated
from it for personal, non-commercial use, through a command line
interface on a personal computer. Your use of this software is subject
to the End User License Agreement, Terms of Use and Privacy Policy at
these URLs:

        https://www.speedtest.net/about/eula
        https://www.speedtest.net/about/terms
        https://www.speedtest.net/about/privacy

==============================================================================

License acceptance recorded. Continuing.


   Speedtest by Ookla

     Server: kdatacenter.com - Seoul (id = 6527)
        ISP: NTT
    Latency:    47.35 ms   (7.76 ms jitter)
   Download:   284.09 Mbps (data used: 436.8 MB)
     Upload:    79.45 Mbps (data used: 152.3 MB)
Packet Loss:     0.0%
 Result URL: https://www.speedtest.net/result/c/7cc958a8-c2f3-4753-be72-07b529c03698
</code></pre>
<p>測定が終了すると結果を出力した後に自動でコンテナが破棄されます。</p>
<h3>エラー時</h3>
<p>エラー時には動作が停止してしまうようなので、<code>Ctrl + C</code>か<code>docker stop [CONTAINER_ID]</code>で停止させてください。</p>
<h2>参考文献</h2>
<ul>
<li><a class="wp-editor-md-post-content-link" href="https://hub.docker.com/repository/docker/kthksgy/speedtest">kthksgy/speedtest | Docker Hub</a></li>
<li><a class="wp-editor-md-post-content-link" href="https://github.com/kthksgy/docker-speedtest">kthksgy/docker-speedtest | GitHub</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.kthksgy.com/docker/docker-speedtest/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
