add kubernetes

This commit is contained in:
dylan
2026-01-09 17:56:38 +08:00
parent 6e7af2d016
commit 2a879d383c
203 changed files with 17379 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
> 本文作者:丁辉
# Docker镜像打包
## 默认打包
1. 打包
```bash
docker save -o image.tar nginx:latest
```
2. 导入
```bash
docker load -i image.tar
```
## 打包并压缩
1. 打包并压缩
```bash
docker save nginx:latest | gzip -c > image.tar.gz
```
2. 解压并导入
```bash
gunzip -c image.tar.gz | docker load
```
## 批量打包
- 第一种
```bash
docker save $(docker images | grep -v REPOSITORY | awk 'BEGIN{OFS=":";ORS=" "}{print $1,$2}') -o k8s-master.tar
```
- 第二种
> 将需要统一打包的镜像写在文件内
```bash
cat > images.txt <<EOF
nginx:alpine
nginx:latest
EOF
```
打包
```bash
docker save -o images.tar.gz $(cat images.txt)
```