1.拉取镜像
docker pull delron/fastdfs
2.创建tracker容器
docker create --network=host --name tracker --restart=always -v fdfs-tracker:/var/fdfs delron/fastdfs tracker
3.创建storage容器
docker create --network=host --name storage --restart=always -e TRACKER_SERVER=192.168.168.168:22122 -v fdfs-storage:/var/fdfs -e GROUP_NAME=group1 delron/fastdfs storage
4.启动容器
docker start tracker
docker start storage
5.进入storage容器
docker exec -it storage /bin/bash
补充:
storage的配置文件/etc/fdfs/storage.conf
(默认的http端口为8888,可以修改也可以配置 http.server_port=8888)
nginx的配置文件/usr/local/nginx/conf/nginx.conf
# 默认配置如下
server {
listen 8888;
server_name localhost;
location ~/group[0-9]/ {
ngx_fastdfs_module;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
分布式文件系统存储目录/var/fdfs/data