docker使用
docker镜像操作
0.下载镜像
1.罗列镜像:docker image ls
2.加载镜像:docker load -i iso
3.删除镜像:docker image rm isoname
4.保存镜像:docker save -o a.rar isoname
5.拉取镜像:docker image pull remote_isoname
docker容器操作
container地址:https://hub.docker.com/search/?operating_system=windows&source=verified&type=image
运行镜像:docker run -it --name=name isoname
后台运行:docker run -dit --name=name isoname
停止容器:docker container stop container_id
运行容器:docker container start container_id
删除容器:docker container rm container_id
停止指定容器:docker stop container_id
罗列详细:docker container ls --all
后台正在运行:docker container ls
停止所有容器:docker stop $(docker ps -a -q)
删除所有容器:docker rm $(docker ps -a -q)
启动/停止/进入容器:
sudo docker start cyber
sudo docker stop cyber
sudo docker attach cyber
进入容器:sudo docker exec -it musing_hertz /bin/bash
fastDFS安装配置
开启tracker服务:
docker run -dti --network=host --name tracker -v /var/fdfs/tracker:/var/fdfs delron/fastdfs tracker
***windows:docker run -dti --network=host --name tracker -v /c/Users/noc/PycharmProjects/meiduomall/fdfs/tracker:/c/Users/noc/PycharmProjects/meiduomall/fdfs delron/fastdfs tracker
停止tracker服务:
docker container stop tracker
开启storage服务:
docker run -dti --network=host --name storage -e TRACKER_SERVER=192.168.229.133:22122 -v /var/fdfs/storage:/var/fdfs delron/fastdfs storage
***windows:docker run -dti --network=host --name storage -e TRACKER_SERVER=192.168.35.37:22122 -v /c/Users/noc/PycharmProjects/meiduomall/fdfs/storage:/c/Users/noc/PycharmProjects/meiduomall/fdfs delron/fastdfs storage
停止storage服务:
docker container stop storage