docker pull season/fastdfs:1.2
#启动tracker
docker run -ti -d --name tracker -p 22122:22122 --restart=always --net=host -v /home/fastdfs/tracker/data:/fastdfs/tracker/data season/fastdfs:1.2 tracker
#启动storage
docker run -tid --name storage --restart=always --net=host -v /home/fastdfs/storage/data:/fastdfs/storage/data -v /home/fastdfs/storage/store_path:/fastdfs/store_path -e TRACKER_SERVER=“内网IP:22122” season/fastdfs:1.2 storage
#进入tracker命令
docker exec -it tracker bash
#将docker中的tracker.conf复制到本地
docker cp tracker:/etc/fdfs/client.conf /home/fastdfs/
#将本地的文件复制到docker中
docker cp /home/fastdfs/client.conf tracker:/etc/fdfs/
#测试文件上传
fdfs_upload_file /etc/fdfs/client.conf a.txt
group1/M00/00/00/CgAMAmMElsmAZzcuAAAABHf4omo058.txt
/home/fastdfs/storage/store_path/data/00/00/CgAMAmMElsmAZzcuAAAABHf4omo058.txt
#nginx配置
#配置拷贝到本地
docker cp storage:/etc/nginx/conf/nginx.conf /home/fastdfs/nginx/
#配置拷贝到docker
docker cp /home/fastdfs/nginx/nginx.conf storage:/etc/nginx/conf/
docker run -id --name fastdfs_nginx --restart=always -v /home/fastdfs/storage/store_path:/fastdfs/store_path -v /home/fastdfs/nginx/nginx.conf:/etc/nginx/conf/nginx.conf -p 8066:8066 -e TRACKER_SERVER=内网IP:22122 season/fastdfs:1.2 nginx
http://外网IP:8066/group1/M00/00/00/CgAMAmMElsmAZzcuAAAABHf4omo058.txt