Skip to main content
  1. Tutorial/

Docker package usage

79 words·1 min
docker
Table of Contents

镜像打包
#

从工作站拉取拉取镜像到本地

docker pull  harbor/test_image:tag_num-linux-amd64

查看镜像版本

docker images | grep test_image

导出镜像到指定位置

docker save -o  ./test_image.tar  harbor/test_image:tag_num-linux-amd64

内网拷贝, 例如从244 拷贝到245

scp ./test_image.tar root@192.168.8.245:/home/images

部署环境(245)加载镜像

cd /home/images
docker load -i ./test_image.tar

重新打Tag

docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]

docker tag harbor/test_image:tag_num-linux-amd64 test_image:v_test
docker build . -t  test:v1
# 删除所有未被 tag 标记和未被容器使用的镜像:
docker image prune
# 删除所有未被容器使用的镜像:
docker image prune -a
# 删除所有停止运行的容器:
docker container prune

#删除所有未被挂载的卷:
docker volume prune

# 删除所有网络:
docker network prune

# 删除 docker 所有资源:
docker system prune

Related

Building Multi-Architecture Docker images
744 words·4 mins
Kiga-Hub
Casual Essay
Architecture docker Arm64
Leverage multi-CPU architecture support # Docker images can support multiple architectures, which means that a single image may contain variants for different architectures, and sometimes for different operating systems, such as Windows.
Ansible: install NTP service
1536 words·8 mins
Ansible
部署目标机配置 # Subnet Ip 配置为 192.
Ansible: Failed to connect to the host via ssh: Permission denied
410 words·2 mins
Ansible
Failed to connect to the host via ssh: Permission denied # 需要设置免密通信, 通过ssh-keygen命令执行生成密钥对
Centos7 install python and pip
77 words·1 min
Python
从源代码编译安装 # 安装构建 Python 所需的依赖包
Centos7: 误删python2导致yum无法使用
219 words·2 mins
Linux
uninstall python # 优先卸载,确保环境干净