Docker容器搭建FASTDFS
1. 获取FastDFS镜像:
docker image pull delron/fastdfs
2.运行tracker:
docker run -dti --network=host --name tracker -v /var/fdfs/tracker:/var/fdfs delron/fastdfs tracker
3.运行storage:
docker run -dti --network=host --name storage -e TRACKER_SERVER=$ip:$port -v /var/fdfs/storage:/var/fdfs delron/fastdfs storage
4.验证安装:
docker container ls --all
测试
- 将一张照片(cumt.png)放置在/var/fdfs/storage目录下
docker exec -it storage /bin/bash
cd /var/fdfs
/usr/bin/fdfs_upload_file /etc/fdfs/client.conf cumt.png
/group1/M00/00/00/wKhQgF5mDoqAWYGyAAAN6jkgJwk203.png