update docker/dockerfile_network/Dockerfile.
1. 当前的 Dockerfile 似乎无法构建, 根据 info.md 的说明, 加入 libserverframe 后可以构建了 2. 原来的 RUN 语句太复杂, 不利于 docker build 时使用多阶段构建缓存 3. 另外, 请教一下, nginx 升级到最新的 1.23 是否有问题, 目前构建nginx是没有问题的 Signed-off-by: alexzshl <alexzshl@126.com>pull/616/head
parent
3109593536
commit
dbd5874fdf
|
|
@ -11,25 +11,81 @@ ADD conf/nginx.conf /etc/fdfs/
|
||||||
ADD conf/mod_fastdfs.conf /etc/fdfs
|
ADD conf/mod_fastdfs.conf /etc/fdfs
|
||||||
|
|
||||||
# run
|
# run
|
||||||
RUN yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel wget vim -y \
|
# install packages
|
||||||
&& cd /usr/local/src \
|
RUN yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel wget vim -y
|
||||||
&& git clone https://github.com/happyfish100/libfastcommon.git --depth 1 \
|
# git clone libfastcommon / libserverframe / fastdfs / fastdfs-nginx-module
|
||||||
&& git clone https://github.com/happyfish100/fastdfs.git --depth 1 \
|
RUN cd /usr/local/src \
|
||||||
&& git clone https://github.com/happyfish100/fastdfs-nginx-module.git --depth 1 \
|
&& git clone https://gitee.com/fastdfs100/libfastcommon.git \
|
||||||
&& wget http://nginx.org/download/nginx-1.15.4.tar.gz \
|
&& git clone https://gitee.com/fastdfs100/libserverframe.git \
|
||||||
&& tar -zxvf nginx-1.15.4.tar.gz \
|
&& git clone https://gitee.com/fastdfs100/fastdfs.git \
|
||||||
&& mkdir /home/dfs \
|
&& git clone https://gitee.com/fastdfs100/fastdfs-nginx-module.git \
|
||||||
&& cd /usr/local/src/ \
|
&& pwd && ls
|
||||||
&& cd libfastcommon/ \
|
# build libfastcommon / libserverframe / fastdfs
|
||||||
&& ./make.sh && ./make.sh install \
|
RUN mkdir /home/dfs \
|
||||||
&& cd ../ \
|
&& cd /usr/local/src \
|
||||||
&& cd fastdfs/ \
|
&& pwd && ls \
|
||||||
&& ./make.sh && ./make.sh install \
|
&& cd libfastcommon/ \
|
||||||
&& cd ../ \
|
&& ./make.sh && ./make.sh install \
|
||||||
&& cd nginx-1.15.4/ \
|
&& cd ../ \
|
||||||
&& ./configure --add-module=/usr/local/src/fastdfs-nginx-module/src/ \
|
&& cd libserverframe/ \
|
||||||
&& make && make install \
|
&& ./make.sh && ./make.sh install \
|
||||||
&& chmod +x /home/fastdfs.sh
|
&& cd ../ \
|
||||||
|
&& cd fastdfs/ \
|
||||||
|
&& ./make.sh && ./make.sh install
|
||||||
|
# download nginx and build with fastdfs-nginx-module
|
||||||
|
# 推荐 NGINX 版本:
|
||||||
|
# NGINX_VERSION=1.16.1
|
||||||
|
# NGINX_VERSION=1.17.10
|
||||||
|
# NGINX_VERSION=1.18.0
|
||||||
|
# NGINX_VERSION=1.19.10
|
||||||
|
# NGINX_VERSION=1.20.2
|
||||||
|
# NGINX_VERSION=1.21.6
|
||||||
|
# NGINX_VERSION=1.22.1
|
||||||
|
# NGINX_VERSION=1.23.3
|
||||||
|
# 可在 docker build 命令中指定使用的 nginx 版本, 例如:
|
||||||
|
# docker build --build-arg NGINX_VERSION="1.16.1" -t happyfish100/fastdfs:latest -t happyfish100/fastdfs:6.09.01 .
|
||||||
|
# docker build --build-arg NGINX_VERSION="1.19.10" -t happyfish100/fastdfs:latest -t happyfish100/fastdfs:6.09.02 .
|
||||||
|
# docker build --build-arg NGINX_VERSION="1.23.3" -t happyfish100/fastdfs:latest -t happyfish100/fastdfs:6.09.03 .
|
||||||
|
ARG NGINX_VERSION=1.16.1
|
||||||
|
RUN cd /usr/local/src \
|
||||||
|
&& NGINX_PACKAGE=nginx-${NGINX_VERSION} \
|
||||||
|
&& NGINX_FILE=${NGINX_PACKAGE}.tar.gz \
|
||||||
|
&& wget http://nginx.org/download/${NGINX_FILE} \
|
||||||
|
&& tar -zxvf ${NGINX_FILE} \
|
||||||
|
&& pwd && ls \
|
||||||
|
&& cd /usr/local/src \
|
||||||
|
&& cd ${NGINX_PACKAGE}/ \
|
||||||
|
&& ./configure --add-module=/usr/local/src/fastdfs-nginx-module/src/ \
|
||||||
|
&& make && make install \
|
||||||
|
&& chmod +x /home/fastdfs.sh
|
||||||
|
|
||||||
|
# 原来的 RUN 语句太复杂, 不利于 docker build 时使用多阶段构建缓存
|
||||||
|
# RUN yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel wget vim -y \
|
||||||
|
# && NGINX_VERSION=1.19.9 \
|
||||||
|
# && NGINX_PACKAGE=nginx-${NGINX_VERSION} \
|
||||||
|
# && NGINX_FILE=${NGINX_PACKAGE}.tar.gz \
|
||||||
|
# && cd /usr/local/src \
|
||||||
|
# && git clone https://gitee.com/fastdfs100/libfastcommon.git \
|
||||||
|
# && git clone https://gitee.com/fastdfs100/libserverframe.git \
|
||||||
|
# && git clone https://gitee.com/fastdfs100/fastdfs.git \
|
||||||
|
# && git clone https://gitee.com/fastdfs100/fastdfs-nginx-module.git \
|
||||||
|
# && wget http://nginx.org/download/${NGINX_FILE} \
|
||||||
|
# && tar -zxvf ${NGINX_FILE} \
|
||||||
|
# && mkdir /home/dfs \
|
||||||
|
# && cd /usr/local/src/ \
|
||||||
|
# && cd libfastcommon/ \
|
||||||
|
# && ./make.sh && ./make.sh install \
|
||||||
|
# && cd ../ \
|
||||||
|
# && cd libserverframe/ \
|
||||||
|
# && ./make.sh && ./make.sh install \
|
||||||
|
# && cd ../ \
|
||||||
|
# && cd fastdfs/ \
|
||||||
|
# && ./make.sh && ./make.sh install \
|
||||||
|
# && cd ../ \
|
||||||
|
# && cd ${NGINX_PACKAGE}/ \
|
||||||
|
# && ./configure --add-module=/usr/local/src/fastdfs-nginx-module/src/ \
|
||||||
|
# && make && make install \
|
||||||
|
# && chmod +x /home/fastdfs.sh
|
||||||
|
|
||||||
RUN ln -s /usr/local/src/fastdfs/init.d/fdfs_trackerd /etc/init.d/fdfs_trackerd \
|
RUN ln -s /usr/local/src/fastdfs/init.d/fdfs_trackerd /etc/init.d/fdfs_trackerd \
|
||||||
&& ln -s /usr/local/src/fastdfs/init.d/fdfs_storaged /etc/init.d/fdfs_storaged
|
&& ln -s /usr/local/src/fastdfs/init.d/fdfs_storaged /etc/init.d/fdfs_storaged
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue