最近升级pure-ftpd的1.0.52版本,在原有基础上,增加了一些需要用到的参数
FROM alpine:3.17
ARG VERSION
ENV PUBLIC_HOST=localhost \
MIN_PASV_PORT=30000 \
MAX_PASV_PORT=30009 \
UID=1000 \
GID=1000
COPY rootfs /
RUN set -ex && \
chmod a+x /usr/bin/entrypoint.sh && \ 新增加
apk add --no-cache \
--virtual .build-deps \
build-base \
curl \
openssl-dev \
bash \
tar && \
cd /tmp && \
curl http://download.techlife.com.cn/pure-ftpd-$VERSION.tar.gz | \ 注意名字按这个格式方便代入参数
tar xz --strip 1 && \
patch -p1 src/ftpd.c minimal.patch && \
./configure \
--prefix=/usr \
--sysconfdir=/etc/pureftpd \
--without-humor \
--with-altlog \ 新增加需要记录日志,否则-O参数用不了
--with-minimal \
--with-throttling \
--with-puredb \
--with-peruserlimits \
--with-ratios \
--with-language=simplified-chinese \ 新增加,支持简体中文
--with-tls && \
make install-strip && \
runDeps="$( \
scanelf --needed --nobanner /usr/sbin/pure-* /usr/bin/pure-* \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| xargs -r apk info --installed \
| sort -u \
)" && \
apk add --no-cache --virtual .run-deps $runDeps && \
cd / && rm -rf /tmp/* && \
apk del .build-deps
VOLUME /home/ftpuser /etc/pureftpd
EXPOSE 21 $MIN_PASV_PORT-$MAX_PASV_PORT
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
CMD /usr/sbin/pure-ftpd \
-P $PUBLIC_HOST \
-p $MIN_PASV_PORT:$MAX_PASV_PORT \
-l puredb:/etc/pureftpd/pureftpd.pdb \
-L 50000:10 \ 新增加
-E \
-O stats:/var/log/pureftpd.log \ 新增加
-j \
-R
ARG VERSION
ENV PUBLIC_HOST=localhost \
MIN_PASV_PORT=30000 \
MAX_PASV_PORT=30009 \
UID=1000 \
GID=1000
COPY rootfs /
RUN set -ex && \
chmod a+x /usr/bin/entrypoint.sh && \ 新增加
apk add --no-cache \
--virtual .build-deps \
build-base \
curl \
openssl-dev \
bash \
tar && \
cd /tmp && \
curl http://download.techlife.com.cn/pure-ftpd-$VERSION.tar.gz | \ 注意名字按这个格式方便代入参数
tar xz --strip 1 && \
patch -p1 src/ftpd.c minimal.patch && \
./configure \
--prefix=/usr \
--sysconfdir=/etc/pureftpd \
--without-humor \
--with-altlog \ 新增加需要记录日志,否则-O参数用不了
--with-minimal \
--with-throttling \
--with-puredb \
--with-peruserlimits \
--with-ratios \
--with-language=simplified-chinese \ 新增加,支持简体中文
--with-tls && \
make install-strip && \
runDeps="$( \
scanelf --needed --nobanner /usr/sbin/pure-* /usr/bin/pure-* \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| xargs -r apk info --installed \
| sort -u \
)" && \
apk add --no-cache --virtual .run-deps $runDeps && \
cd / && rm -rf /tmp/* && \
apk del .build-deps
VOLUME /home/ftpuser /etc/pureftpd
EXPOSE 21 $MIN_PASV_PORT-$MAX_PASV_PORT
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
CMD /usr/sbin/pure-ftpd \
-P $PUBLIC_HOST \
-p $MIN_PASV_PORT:$MAX_PASV_PORT \
-l puredb:/etc/pureftpd/pureftpd.pdb \
-L 50000:10 \ 新增加
-E \
-O stats:/var/log/pureftpd.log \ 新增加
-j \
-R
原创文章,转载请注明: 转载自混沌
本文链接地址: 记录一个pure-ftpd的Dockerfile