Commit 06c201d5 authored by chenpangpang's avatar chenpangpang
Browse files

feat: 新增保存镜像脚本

parent 24037762
...@@ -109,7 +109,7 @@ The output image has been saved as output.png ...@@ -109,7 +109,7 @@ The output image has been saved as output.png
![output.png](assert/output.png)<br> ![output.png](assert/output.png)<br>
确认`输出图片`是否符合预期。 确认`输出图片`是否符合预期。
## 打包镜像 ## 打包镜像
运行`docker save -o $FILENAME $IMAGE_NAME`打包镜像 运行`sh script/save.sh $IMAGE_NAME`保存镜像
## TODO: ## TODO:
- 从docker hub获取镜像tag - 从docker hub获取镜像tag
......
#!/bin/bash
# 检查是否提供了输入字符串
if [ "$#" -ne 1 ]; then
echo "Error: No image name provided."
exit 1
fi
# 读取输入字符串
image_name=$1
# 使用tr命令将:替换为-
filename=$(echo "$image_name".tar | tr ':' '-')
echo "docker save -o $filename $image_name"
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment