Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
gpu-base-image-build
Commits
06c201d5
Commit
06c201d5
authored
Sep 19, 2024
by
chenpangpang
Browse files
feat: 新增保存镜像脚本
parent
24037762
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
README.md
README.md
+1
-1
script/save.sh
script/save.sh
+13
-0
No files found.
README.md
View file @
06c201d5
...
@@ -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

<br>

<br>
确认
`输出图片`
是否符合预期。
确认
`输出图片`
是否符合预期。
## 打包镜像
## 打包镜像
运行
`
docker save -o $FILENAME
$IMAGE_NAME`
打包
镜像
。
运行
`
sh script/save.sh
$IMAGE_NAME`
保存
镜像
## TODO:
## TODO:
-
从docker hub获取镜像tag
-
从docker hub获取镜像tag
...
...
script/save.sh
0 → 100644
View file @
06c201d5
#!/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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment