相关文章
暂无评论...
Docker中管理和操作镜像及容器的主要命令汇总,包括创建、管理、删除镜像以及操作容器的关键命令:
docker search <image_name>
docker pull <image_name>
docker images
docker history <image_id_or_name>
docker tag <image> <new_image_name>
docker build -t <image_name> .
docker rmi <image_id_or_name>
docker rmi image1 image2 ...
docker rmi $(docker images -f "dangling=true" -q)
docker rmi -f <image_id_or_name>
docker run <image_name>
docker exec -it <container_id_or_name> /bin/bash
docker ps
docker ps -a
docker logs <container_id_or_name>
docker stop <container_id_or_name>
docker start <container_id_or_name>
docker rm <container_id_or_name>
docker stats
docker export <container_id_or_name> > <output_file.tar>
cat <input_file.tar> | docker import - <image_name>
docker inspect <container_id_or_name>
docker restart <container_id_or_name>
docker pause <container_id_or_name>
- 恢复
docker unpause <container_id_or_name>
以上命令覆盖了Docker中镜像和容器操作的基本需求,是进行Docker应用开发和维护的重要工具集。