<?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; Simon</title>
	<atom:link href="https://www.luisimon.com/category/docker/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.luisimon.com</link>
	<description>blog</description>
	<lastBuildDate>Tue, 28 May 2024 07:05:30 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>

<image>
	<url>https://www.luisimon.com/wp-content/uploads/2019/09/cbrks-x5t4i-001.ico</url>
	<title>Docker &#8211; Simon</title>
	<link>https://www.luisimon.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>打包和导入Docker镜像（教程）</title>
		<link>https://www.luisimon.com/2023/07/05/718/</link>
		
		<dc:creator><![CDATA[Simon]]></dc:creator>
		<pubDate>Wed, 05 Jul 2023 13:55:24 +0000</pubDate>
				<category><![CDATA[Docker]]></category>
		<guid isPermaLink="false">https://www.luisimon.com/?p=718</guid>

					<description><![CDATA[打包Docker镜像 命令格式 或者使用下面的脚本批量导出 打包导出的镜像文件，以压缩文件体积 解压压缩包 导 ... <a title="打包和导入Docker镜像（教程）" class="read-more" href="https://www.luisimon.com/2023/07/05/718/" aria-label="继续阅读打包和导入Docker镜像（教程）">阅读更多</a>]]></description>
										<content:encoded><![CDATA[
<p>打包Docker镜像</p>



<p>命令格式</p>



<pre class="wp-block-code"><code>docker save -o your_image.tar &#91;IMAGE_ID]</code></pre>



<p>或者使用下面的脚本批量导出</p>



<pre class="wp-block-code"><code>\#!/bin/bash
docker images &gt; images.txt
awk '{print $1}' images.txt &gt; images_cut.txt
sed -i '1d' images_cut.txt
mkdir dockerImages
while read LINE
do
  FILENAME="${LINE//\//_}.train.tar"
  docker save "$LINE" &gt; "dockerImages/$FILENAME"
  echo "$FILENAME" &gt;&gt; tarName.txt
  echo "ok"
done &lt; images_cut.txt
echo "finish"</code></pre>



<p>打包导出的镜像文件，以压缩文件体积</p>



<pre class="wp-block-code"><code>zip -r dockerImages.zip dockerImages
</code></pre>



<p>解压压缩包</p>



<pre class="wp-block-code"><code>unzip dockerImages.zip -d &#91;targetDirectory]</code></pre>



<p>导入镜像</p>



<pre class="wp-block-code"><code>docker  load -i &#91;image.tar]</code></pre>



<p>批量导入镜像</p>



<pre class="wp-block-code"><code>cat tarName.txt | while read LINE
do
    # 在这里处理每一行的内容
    docker  load -i $LINE
done</code></pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
