Skip to content

Commit

Permalink
fastdfs合并镜像
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix2yu committed Feb 21, 2024
1 parent 498c771 commit 8483038
Showing 1 changed file with 17 additions and 27 deletions.
44 changes: 17 additions & 27 deletions fastdfs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
FROM debian:stable as builder

ENV FASTDFS_PATH=/opt/fdfs \
FASTDFS_BASE_PATH=/data/fdfs \
LIBFASTCOMMON_VERSION="V1.0.42" \
FASTDFS_VERSION="V5.12"

WORKDIR ${FASTDFS_PATH}
RUN apt-get update && \
apt-get install -y git gcc make

RUN git clone -b $LIBFASTCOMMON_VERSION https://github.com/happyfish100/libfastcommon.git && \
cd libfastcommon && \
./make.sh

RUN git clone -b $FASTDFS_VERSION https://github.com/happyfish100/fastdfs.git && \
cd fastdfs && \
./make.sh

FROM debian:stable-slim
FROM debian:stable

LABEL org.opencontainers.image.source = "https://github.com/Felix2yu/docker_build" \
maintainer="Felix2yu <yufei.im@icloud.com>" \
Expand All @@ -26,18 +7,27 @@ LABEL org.opencontainers.image.source = "https://github.com/Felix2yu/docker_buil
ENV FASTDFS_PATH=/opt/fdfs \
FASTDFS_BASE_PATH=/data/fdfs \
TZ=Asia/Shanghai \
FASTDFS_MODE=
FASTDFS_MODE= \
LIBFASTCOMMON_VERSION="V1.0.42" \
FASTDFS_VERSION="V5.12"

COPY --from=builder ${FASTDFS_PATH} ${FASTDFS_PATH}
COPY entrypoint.sh /usr/bin/

RUN chmod +x /usr/bin/entrypoint.sh && \
apt-get update && \
apt-get install -y --no-install-recommends make && \
cd ${FASTDFS_PATH}/libfastcommon && ./make.sh install && \
cd ${FASTDFS_PATH}/fastdfs && ./make.sh install && \
mkdir -p ${FASTDFS_BASE_PATH} && \
apt-get clean -y && rm -rf /var/lib/apt/lists/* /var/cache/apt
apt-get install -y git gcc make && \
mkdir -p ${FASTDFS_BASE_PATH} ${FASTDFS_PATH}/libfastcommon ${FASTDFS_PATH}/fastdfs && \
git clone -b $LIBFASTCOMMON_VERSION https://github.com/happyfish100/libfastcommon.git ${FASTDFS_PATH}/libfastcommon && \
cd ${FASTDFS_PATH}/libfastcommon && \
./make.sh && \
./make.sh install && \
git clone -b $FASTDFS_VERSION https://github.com/happyfish100/fastdfs.git ${FASTDFS_PATH}/fastdfs && \
cd ${FASTDFS_PATH}/fastdfs && \
./make.sh && \
./make.sh install && \
apt-get autoremove -y git gcc make && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/* /var/cache/apt

EXPOSE 22122 23000
VOLUME ["$FASTDFS_BASE_PATH","/etc/fdfs"]
Expand Down

0 comments on commit 8483038

Please sign in to comment.