1.拉取镜像
docker pull morunchang/fastdfs
2.运行tracker服务
docker run -d --name tracker --net=host morunchang/fastdfs sh tracker.sh
3.运行storage服务
docker run -d --privileged=true --name storage --net=host -e TRACKER_IP=<your tracker server address>:22122 -v /home/fastdfs:/data/fast_data/data -e GROUP_NAME=<group name> morunchang/fastdfs sh storage.sh
4.进入容器(docker exec -it storage /bin/bash),修改/data/nginx/conf/nginx.conf下的文件,加上下面内容
location /<group name>/M00 {
proxy_next_upstream http_502 http_504 error timeout invalid_header;
proxy_cache http-cache;
proxy_cache_valid 200 304 12h;
proxy_cache_key $uri$is_args$args;
proxy_pass http://fdfs_group1;
expires 30d;
}
5.storage启动时配置的http端口为8080,可能会有冲突
修改/etc/fdfs下边tracker.conf和tracker.conf.sample的http.server_port配置项和
修改 /etc/nginx/conf/nginx.conf 端口为8888