这是一个简单pull即可使用的fdfs分布式文件系统镜像,内置运行nginx配合fdfs可实现http下载。
fdfs相关配置挂载目录
/etc/fdfs/tracker.conf /etc/fdfs/storage.conf
nginx相关配置挂载目录
/etc/fdfs/mod_fastdfs.conf /opt/nginx/conf/nginx.conf
fdfs相关数据挂载目录
/fastdfs/storage/data /fastdfs/tracker
$ docker pull ly15326047083/fdfs:1.0
# nginx 监听ip
NGINX_IP=127.0.0.1
# nginx 中监听端口
FDFS_PORT=80
# tracker服务ip
TRACKER_IP=127.0.0.1
# tracker服务端口
TRACKER_PORT=22122
# strage服务端口
STORAGE_PORT=23000
# 超时时间
CONNECT_TIMEOUT=10
# 挂载配置
$ docker run -d -v /宿主机路径/tracker.conf:/etc/fdfs/tracker.conf -v /宿主机路径/storage.conf:/etc/fdfs/storage.conf --name 自定义容器名称 ly15326047083/fdfs:1.0
# 挂载数据
$ docker run -d -v /宿主机路径/storage/data:/fastdfs/storage/data --name 自定义容器名称 ly15326047083/fdfs:1.0
# 使用环境变量
$ docker run -d -e "FDFS_PORT=80" --name fdfs ly15326047083/fdfs:1.0
# 使用示例
$ docker run -d -p 80:80 -p 22122:22122 -p 23000:23000 -e "NGINX_IP=192.168.2.23" -e "TRACKER_IP=192.168.2.23" -e "FDFS_PORT=80" -e "TRACKER_PORT=22122" -e "STORAGE_PORT=23000" -e "CONNECT_TIMEOUT=10" --name fdfs
FROM hub.c.163.com/public/centos:7.2-tools
MAINTAINER Leiyuan
ADD https://github.com/happyfish100/libfastcommon/archive/V1.0.39.tar.gz /root/leiyuan/
ADD https://github.com/happyfish100/fastdfs/archive/V5.11.tar.gz /root/leiyuan/
ADD https://github.com/happyfish100/fastdfs-nginx-module/archive/V1.20.tar.gz /root/leiyuan/
ADD http://nginx.org/download/nginx-1.12.2.tar.gz /root/leiyuan/
COPY startup.sh /root/
COPY fdfs /etc/fdfs/
COPY fdfs_nginx_config /root/leiyuan/
COPY nginx.conf /root/leiyuan/
RUN curl http://mirrors.aliyun.com/repo/Centos-7.repo | grep -v 'mirrors.aliyuncs.com' > /etc/yum.repos.d/CentOS-Base.repo \
&&curl http://mirrors.aliyun.com/repo/epel-7.repo | grep -v 'mirrors.aliyuncs.com' > /etc/yum.repos.d/epel-7.repo \
&&yum clean all \
&&yum makecache \
&&yum -y update \
&&yum -y install zlib zlib-devel pcre pcre-devel gcc gcc-c++ openssl openssl-devel libevent libevent-devel perl \
&&yum -y install gcc automake autoconf libtool make \
&&cd /root/leiyuan/ \
&&tar -zxvf V1.0.39.tar.gz \
&&tar -zxvf V5.11.tar.gz \
&&tar -zxvf V1.20.tar.gz \
&&tar -zxvf nginx-1.12.2.tar.gz \
&&rm -rf V1.0.39.tar.gz \
&&rm -rf V5.11.tar.gz \
&&rm -rf V1.20.tar.gz \
&&rm -rf nginx-1.12.2.tar.gz \
&&cd /root/leiyuan/libfastcommon-1.0.39 \
&&./make.sh \
&&./make.sh install \
&&cd /root/leiyuan/fastdfs-5.11 \
&&./make.sh \
&&./make.sh install \
&&mkdir -p /fastdfs/tracker \
&&mkdir -p /fastdfs/storage \
&&cd /root/leiyuan/fastdfs-nginx-module-1.20/ \
&&\cp /root/leiyuan/fdfs_nginx_config src/config \
&&cd /root/leiyuan/nginx-1.12.2/ \
&&./configure --prefix=/opt/nginx --add-module=/root/leiyuan/fastdfs-nginx-module-1.20/src \
&&make \
&&make install \
&&\cp /root/leiyuan/nginx.conf /opt/nginx/conf/ \
&&mkdir -p /fastdfs/storage \
&&mkdir -p /fastdfs/tracker
ENV NGINX_IP=127.0.0.1 FDFS_PORT=80 TRACKER_IP=127.0.0.1 TRACKER_PORT=22122 STORAGE_PORT=23000 CONNECT_TIMEOUT=10
CMD ["bash", "/root/startup.sh"]
Content type
Image
Digest
Size
427.6 MB
Last updated
about 7 years ago
docker pull ly15326047083/fdfs:2.0