-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-centos
46 lines (40 loc) · 1.61 KB
/
Dockerfile-centos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# centos 7
FROM centos:7
#环境变量
ENV TZ "Asia/Shanghai"
# conf
COPY conf/* /opt/
COPY fastdfs.sh /home/
# run
# install packages
RUN yum -y install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel wget vim
# git clone libfastcommon / libserverframe / fastdfs / fastdfs-nginx-module
RUN set -x \
&& cd /usr/local/src \
&& git clone -b V1.0.68 https://github.com/happyfish100/libfastcommon.git --depth 1 \
&& git clone -b V1.1.28 https://github.com/happyfish100/libserverframe.git --depth 1 \
&& git clone -b V6.09 https://github.com/happyfish100/fastdfs.git --depth 1 \
&& git clone -b V1.23 https://github.com/happyfish100/fastdfs-nginx-module.git --depth 1 \
&& wget http://nginx.org/download/nginx-1.22.1.tar.gz
# build libfastcommon / libserverframe / fastdfs
RUN set -x \
&& mkdir /home/dfs \
&& cd /usr/local/src \
&& cd /usr/local/src/libfastcommon \
&& ./make.sh && ./make.sh install \
&& cd /usr/local/src/libserverframe \
&& ./make.sh && ./make.sh install \
&& cd /usr/local/src/fastdfs \
&& ./make.sh && ./make.sh install \
&& cd /usr/local/src \
&& tar -zxvf nginx-1.22.1.tar.gz \
&& cd /usr/local/src/nginx-1.22.1 \
&& ./configure --add-module=/usr/local/src/fastdfs-nginx-module/src \
&& make && make install \
&& chmod +x /home/fastdfs.sh
RUN cp /usr/local/src/fastdfs/init.d/fdfs_trackerd /etc/init.d/fdfs_trackerd \
&& cp /usr/local/src/fastdfs/init.d/fdfs_storaged /etc/init.d/fdfs_storaged \
&& rm -rf /usr/local/src*
VOLUME /home/dfs
EXPOSE 22122 23000 80
ENTRYPOINT ["/home/fastdfs.sh"]