制作fastdfs的dockerfile

FROM centos:7.2.1511

WORKDIR /etc/fdfs

RUN yum -y install zlib zlib-devel pcre pcre-devel gcc gcc-c++ openssl openssl-devel libevent libevent-devel perl unzip net-tools wget
RUN mkdir -p /usr/local/fast
RUN cd /usr/local/fast && wget https://github.com/happyfish100/libfastcommon/archive/V1.0.7.tar.gz && tar -zxvf V1.0.7.tar.gz && rm -rf V1.0.7.tar.gz && wget https://github.com/happyfish100/fastdfs/archive/V5.05.tar.gz && tar -zxvf V5.05.tar.gz && rm -rf V5.05.tar.gz
RUN cd /usr/local/fast/libfastcommon-1.0.7 && ./make.sh && ./make.sh install
RUN ln -s /usr/lib64/libfastcommon.so /usr/local/lib/libfastcommon.so
RUN ln -s /usr/lib64/libfastcommon.so /usr/lib/libfastcommon.so
RUN ln -s /usr/lib64/libfdfsclient.so /usr/local/lib/libfdfsclient.so
RUN ln -s /usr/lib64/libfdfsclient.so /usr/lib/libfdfsclient.so
RUN cd /usr/local/fast/fastdfs-5.05 && ./make.sh && ./make.sh install
RUN find /etc/init.d/fdfs_trackerd | xargs perl -pi -e 's|/usr/local/bin|/usr/bin|g'
RUN mkdir -m 777 -p /fdfs/fdfs_con
RUN cd /etc/fdfs && cp client.conf.sample client.conf && cp storage.conf.sample storage.conf && cp tracker.conf.sample tracker.conf

更新文件

RUN find /etc/fdfs/*.conf | xargs perl -pi -e 's|/home/yuqing/fastdfs|/fdfs/fdfs_con|g'
RUN cd /etc/fdfs && echo '/etc/init.d/fdfs_trackerd start' >a.sh
RUN cd /etc/fdfs && echo 'tail -f /fdfs/fdfs_con/logs/trackerd.log' >>a.sh
WORKDIR /etc/fdfs

EXPOSE 8080

CMD ["/etc/init.d/fdfs_trackerd", "start"]

/var/fdfs/tracker
/var/fdfs/storage
/cc/client.conf

上一篇:修复过的一个bug


下一篇:Automony公司的UltraSeek产品