Sign inSign up

nujw/fastdfs

By nujw

Updated over 6 years ago

fastdfs + timezone(Asia/Shanghai)

Image
0

231

nujw/fastdfs repository overview

单机版

run (采用的host网络,暴露端口 22122 23000 8888 ,其中192.168.1.10为宿主机ip)
docker run -d --name fastdfs --restart=always \
    --net host \
    -e FASTDFS_IPADDR=192.168.1.10 \
    -v $PWD/dfs:/home/dfs \
    nujw/fastdfs:6.06
Dockerfile ( 根据susanoo/fastdfs微调)
FROM alpine:3.10
RUN set -x \
    && echo "http://mirrors.aliyun.com/alpine/latest-stable/main/" > /etc/apk/repositories \
    && echo "http://mirrors.aliyun.com/alpine/latest-stable/community/" >> /etc/apk/repositories \
    && apk update \
    && apk add --no-cache --virtual .build-deps alpine-sdk gcc libc-dev make perl-dev openssl-dev pcre-dev zlib-dev git tzdata \
    && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && echo "Asia/Shanghai" > /etc/timezone \
    && mkdir -p /usr/local/src \
    && cd /usr/local/src \
    && git clone https://github.com/happyfish100/libfastcommon.git --depth 1 \
    && git clone https://github.com/happyfish100/fastdfs.git --depth 1    \
    && git clone https://github.com/happyfish100/fastdfs-nginx-module.git --depth 1  \
    && wget http://nginx.org/download/nginx-1.15.4.tar.gz \
    && tar -xf nginx-1.15.4.tar.gz \
    && cd /usr/local/src/libfastcommon \
    && ./make.sh \
    && ./make.sh install \
    && cd /usr/local/src/fastdfs/ \
    && ./make.sh \
    && ./make.sh install \
    && cd /usr/local/src/nginx-1.15.4/ \
    && ./configure --add-module=/usr/local/src/fastdfs-nginx-module/src/ \
    && make && make install \
    && apk del .build-deps \
    && apk add --no-cache pcre-dev bash \
    && mkdir -p /home/dfs  \
    && mv /usr/local/src/fastdfs/docker/dockerfile_network/fastdfs.sh /home \
    && mv /usr/local/src/fastdfs/docker/dockerfile_network/conf/* /etc/fdfs \
    && chmod +x /home/fastdfs.sh \
    && rm -rf /usr/local/src*
VOLUME /home/dfs
EXPOSE 22122 23000 8888
CMD ["/home/fastdfs.sh"]
查看
docker exec -it fastdfs fdfs_monitor /etc/fdfs/storage.conf

集群

部署2套单机版本,如(192.168.1.10 , 192.168.1.11)

docker exec -it fastdfs /bin/bash

分别修改 /etc/fdfs 下的 storage.conf ,mod_fastdfs.conf 文件,添加 tracker_server 地址,添加后如下

tracker_server=192.168.1.10:22122
tracker_server=192.168.1.11:22122

最后重启2个fastdfs容器

查看状态,有2个Storage

docker exec -it fastdfs fdfs_monitor /etc/fdfs/storage.conf

Tag summary

Content type

Image

Digest

Size

14.2 MB

Last updated

over 6 years ago

docker pull nujw/fastdfs