Skip to content

Commit c2b84c8

Browse files
committed
V6.11.0
1 parent 3548da9 commit c2b84c8

File tree

8 files changed

+428
-191
lines changed

8 files changed

+428
-191
lines changed

Dockerfile

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
# debian
2-
FROM debian:bullseye-slim
2+
FROM debian:bookworm-slim
33

44
ARG NGINX_VERSION=1.26.2
55

66
ENV TZ "Asia/Shanghai"
77

88
# conf
9-
COPY conf/* /opt/
10-
COPY fastdfs.sh /home/
9+
COPY conf/* /home/
10+
COPY fastdfs.sh /usr/local/bin/
1111

1212
# run
1313
# install packages
1414
RUN set -x \
15+
# && sed -i 's|deb.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/debian.sources \
1516
&& apt-get update \
1617
&& apt-get install -y --no-install-recommends \
1718
ca-certificates \
@@ -28,34 +29,35 @@ RUN set -x \
2829

2930
# git clone libfastcommon / libserverframe / fastdfs / fastdfs-nginx-module
3031
RUN set -x \
31-
&& cd /usr/local/src \
32-
&& git clone -b V1.0.68 https://github.com/happyfish100/libfastcommon.git --depth 1 \
33-
&& git clone -b V1.1.28 https://github.com/happyfish100/libserverframe.git --depth 1 \
34-
&& git clone -b V6.09 https://github.com/happyfish100/fastdfs.git --depth 1 \
35-
&& git clone -b V1.23 https://github.com/happyfish100/fastdfs-nginx-module.git --depth 1 \
32+
&& mkdir /opt/tmp \
33+
&& cd /opt/tmp \
34+
&& git clone -b V1.0.71 https://github.com/happyfish100/libfastcommon.git --depth 1 \
35+
&& git clone -b V1.2.1 https://github.com/happyfish100/libserverframe.git --depth 1 \
36+
&& git clone -b V6.11.0 https://github.com/happyfish100/fastdfs.git --depth 1 \
37+
&& git clone -b V1.24 https://github.com/happyfish100/fastdfs-nginx-module.git --depth 1 \
3638
&& wget https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz
3739
# build libfastcommon / libserverframe / fastdfs
3840
RUN set -x \
39-
&& mkdir /home/dfs \
40-
&& cd /usr/local/src \
41-
&& cd /usr/local/src/libfastcommon \
41+
&& mkdir /opt/fastdfs \
42+
&& cd /opt/tmp \
43+
&& cd /opt/tmp/libfastcommon \
4244
&& ./make.sh && ./make.sh install \
43-
&& cd /usr/local/src/libserverframe \
45+
&& cd /opt/tmp/libserverframe \
4446
&& ./make.sh && ./make.sh install \
45-
&& cd /usr/local/src/fastdfs \
47+
&& cd /opt/tmp/fastdfs \
4648
&& ./make.sh && ./make.sh install \
47-
&& cd /usr/local/src \
49+
&& cd /opt/tmp \
4850
&& tar -zxvf nginx-$NGINX_VERSION.tar.gz \
49-
&& cd /usr/local/src/nginx-$NGINX_VERSION \
50-
&& ./configure --add-module=/usr/local/src/fastdfs-nginx-module/src \
51+
&& cd /opt/tmp/nginx-$NGINX_VERSION \
52+
&& ./configure --add-module=/opt/tmp/fastdfs-nginx-module/src \
5153
&& make && make install \
52-
&& chmod +x /home/fastdfs.sh
54+
&& chmod +x /usr/local/bin/fastdfs.sh
5355

54-
RUN cp /usr/local/src/fastdfs/init.d/fdfs_trackerd /etc/init.d/fdfs_trackerd \
55-
&& cp /usr/local/src/fastdfs/init.d/fdfs_storaged /etc/init.d/fdfs_storaged \
56-
&& rm -rf /usr/local/src*
56+
RUN cp /opt/tmp/fastdfs/init.d/fdfs_trackerd /usr/local/bin/fdfs_trackerd \
57+
&& cp /opt/tmp/fastdfs/init.d/fdfs_storaged /usr/local/bin/fdfs_storaged \
58+
&& rm -rf /opt/tmp
5759

58-
VOLUME /home/dfs
60+
VOLUME /opt/fastdfs
5961

6062
EXPOSE 22122 23000 80
61-
ENTRYPOINT ["/home/fastdfs.sh"]
63+
ENTRYPOINT ["fastdfs.sh"]

Dockerfile-alpine

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,56 @@
11
#基础镜像
2-
FROM alpine:3.18
2+
FROM alpine:3.20
33

44
ARG NGINX_VERSION=1.26.2
55

66
ENV TZ "Asia/Shanghai"
77

88
# conf
9-
COPY conf/* /opt/
10-
COPY fastdfs.sh /home/
9+
COPY conf/* /home/
10+
COPY fastdfs.sh /usr/local/bin/
1111

1212
# run
1313
# install packages
1414
RUN set -x \
15+
# && sed -i 's#https\?://dl-cdn.alpinelinux.org/alpine#https://mirrors.tuna.tsinghua.edu.cn/alpine#g' /etc/apk/repositories \
1516
&& apk update \
1617
&& apk add --no-cache --virtual .build-deps alpine-sdk build-base perl-dev openssl-dev pcre-dev zlib-dev git
18+
1719
# git clone libfastcommon / libserverframe / fastdfs / fastdfs-nginx-module
1820
RUN set -x \
19-
&& mkdir -p /usr/local/src \
20-
&& cd /usr/local/src \
21-
&& git clone -b V1.0.68 https://github.com/happyfish100/libfastcommon.git --depth 1 \
22-
&& git clone -b V1.1.28 https://github.com/happyfish100/libserverframe.git --depth 1 \
23-
&& git clone -b V6.09 https://github.com/happyfish100/fastdfs.git --depth 1 \
24-
&& git clone -b V1.23 https://github.com/happyfish100/fastdfs-nginx-module.git --depth 1 \
21+
&& mkdir -p /opt/tmp \
22+
&& cd /opt/tmp \
23+
&& git clone -b V1.0.71 https://github.com/happyfish100/libfastcommon.git --depth 1 \
24+
&& git clone -b V1.2.1 https://github.com/happyfish100/libserverframe.git --depth 1 \
25+
&& git clone -b V6.11.0 https://github.com/happyfish100/fastdfs.git --depth 1 \
26+
&& git clone -b V1.24 https://github.com/happyfish100/fastdfs-nginx-module.git --depth 1 \
2527
&& wget https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz
28+
2629
# build libfastcommon / libserverframe / fastdfs
2730
RUN set -x \
28-
&& mkdir /home/dfs \
29-
&& cd /usr/local/src \
30-
&& cd /usr/local/src/libfastcommon \
31+
&& mkdir /opt/fastdfs \
32+
&& cd /opt/tmp \
33+
&& cd /opt/tmp/libfastcommon \
3134
&& ./make.sh && ./make.sh install \
32-
&& cd /usr/local/src/libserverframe \
35+
&& cd /opt/tmp/libserverframe \
3336
&& ./make.sh && ./make.sh install \
34-
&& cd /usr/local/src/fastdfs \
37+
&& cd /opt/tmp/fastdfs \
3538
&& ./make.sh && ./make.sh install \
36-
&& cd /usr/local/src \
39+
&& cd /opt/tmp \
3740
&& tar -zxvf nginx-$NGINX_VERSION.tar.gz \
38-
&& cd /usr/local/src/nginx-$NGINX_VERSION \
39-
&& ./configure --add-module=/usr/local/src/fastdfs-nginx-module/src \
41+
&& cd /opt/tmp/nginx-$NGINX_VERSION \
42+
&& ./configure --add-module=/opt/tmp/fastdfs-nginx-module/src \
4043
&& make && make install \
4144
&& apk del .build-deps \
4245
&& apk add --no-cache pcre-dev bash curl tzdata \
43-
&& chmod +x /home/fastdfs.sh
46+
&& chmod +x /usr/local/bin/fastdfs.sh
4447

45-
RUN cp /usr/local/src/fastdfs/init.d/fdfs_trackerd /etc/init.d/fdfs_trackerd \
46-
&& cp /usr/local/src/fastdfs/init.d/fdfs_storaged /etc/init.d/fdfs_storaged \
47-
&& rm -rf /usr/local/src*
48+
RUN cp /opt/tmp/fastdfs/init.d/fdfs_trackerd /usr/local/bin/fdfs_trackerd \
49+
&& cp /opt/tmp/fastdfs/init.d/fdfs_storaged /usr/local/bin/fdfs_storaged \
50+
&& rm -rf /opt/tmp*
4851

49-
VOLUME /home/dfs
52+
VOLUME /opt/fastdfs
5053

5154
EXPOSE 22122 23000 80
5255

53-
CMD ["/home/fastdfs.sh"]
56+
CMD ["fastdfs.sh"]

conf/client.conf

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,30 @@
11
# connect timeout in seconds
22
# default value is 30s
3-
connect_timeout=30
3+
# Note: in the intranet network (LAN), 2 seconds is enough.
4+
connect_timeout = 5
45

56
# network timeout in seconds
67
# default value is 30s
7-
network_timeout=60
8+
network_timeout = 60
89

910
# the base path to store log files
10-
base_path=/home/dfs
11+
base_path = /opt/fastdfs
1112

12-
# tracker_server can ocur more than once, and tracker_server format is
13-
# "host:port", host can be hostname or ip address
14-
tracker_server=###TRACKER###
13+
# tracker_server can ocur more than once for multi tracker servers.
14+
# the value format of tracker_server is "HOST:PORT",
15+
# the HOST can be hostname or ip address,
16+
# and the HOST can be dual IPs or hostnames seperated by comma,
17+
# the dual IPS must be an inner (intranet) IP and an outer (extranet) IP,
18+
# or two different types of inner (intranet) IPs.
19+
# IPv4:
20+
# for example: 192.168.2.100,122.244.141.46:22122
21+
# another eg.: 192.168.1.10,172.17.4.21:22122
22+
#
23+
# IPv6:
24+
# for example: [2409:8a20:42d:2f40:587a:4c47:72c0:ad8e,fe80::1ee9:90a8:1351:436c]:22122
25+
#
26+
# tracker_server = 192.168.0.196:22122
27+
tracker_server = ###TRACKER###
1528

1629
#standard log level as syslog, case insensitive, value list:
1730
### emerg for emergency
@@ -22,7 +35,14 @@ tracker_server=###TRACKER###
2235
### notice
2336
### info
2437
### debug
25-
log_level=info
38+
log_level = info
39+
40+
# connect which ip address first for multi IPs of a storage server, value list:
41+
## tracker: connect to the ip address return by tracker server first
42+
## last-connected: connect to the ip address last connected first
43+
# default value is tracker
44+
# since V6.11
45+
connect_first_by = tracker
2646

2747
# if use connection pool
2848
# default value is false
@@ -38,7 +58,7 @@ connection_pool_max_idle_time = 3600
3858
# if load FastDFS parameters from tracker server
3959
# since V4.05
4060
# default value is false
41-
load_fdfs_parameters_from_tracker=false
61+
load_fdfs_parameters_from_tracker = false
4262

4363
# if use storage ID instead of IP address
4464
# same as tracker.conf
@@ -55,7 +75,7 @@ storage_ids_filename = storage_ids.conf
5575

5676

5777
#HTTP settings
58-
http.tracker_server_port=80
78+
http.tracker_server_port = 80
5979

6080
#use "#include" directive to include HTTP other settiongs
6181
##include http.conf

conf/mod_fastdfs.conf

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# connect timeout in seconds
22
# default value is 30s
3-
connect_timeout=2
3+
connect_timeout = 2
44

55
# network recv and send timeout in seconds
66
# default value is 30s
7-
network_timeout=30
7+
network_timeout = 30
88

99
# the base path to store log files
10-
base_path=/tmp
10+
base_path = /tmp
1111

1212
# if load FastDFS parameters from tracker server
1313
# since V1.12
1414
# default value is false
15-
load_fdfs_parameters_from_tracker=true
15+
load_fdfs_parameters_from_tracker = true
1616

1717
# storage sync file max delay seconds
1818
# same as tracker.conf
@@ -37,14 +37,14 @@ storage_ids_filename = storage_ids.conf
3737
# FastDFS tracker_server can ocur more than once, and tracker_server format is
3838
# "host:port", host can be hostname or ip address
3939
# valid only when load_fdfs_parameters_from_tracker is true
40-
tracker_server=###TRACKER###
40+
tracker_server = ###TRACKER###
4141

4242
# the port of the local storage server
4343
# the default value is 23000
44-
storage_server_port=23000
44+
storage_server_port = 23000
4545

4646
# the group name of the local storage server
47-
group_name=group1
47+
group_name = group1
4848

4949
# if the url / uri including the group name
5050
# set to false when uri like /M00/00/00/xxx
@@ -54,12 +54,12 @@ url_have_group_name = true
5454

5555
# path(disk or mount point) count, default value is 1
5656
# must same as storage.conf
57-
store_path_count=1
57+
store_path_count = 1
5858

5959
# store_path#, based 0, if store_path0 not exists, it's value is base_path
6060
# the paths must be exist
6161
# must same as storage.conf
62-
store_path0=/home/dfs
62+
store_path0 = /opt/fastdfs
6363
#store_path1=/home/yuqing/fastdfs1
6464

6565
# standard log level as syslog, case insensitive, value list:
@@ -71,22 +71,22 @@ store_path0=/home/dfs
7171
### notice
7272
### info
7373
### debug
74-
log_level=info
74+
log_level = info
7575

7676
# set the log filename, such as /usr/local/apache2/logs/mod_fastdfs.log
7777
# empty for output to stderr (apache and nginx error_log file)
78-
log_filename=
78+
log_filename =
7979

8080
# response mode when the file not exist in the local file system
8181
## proxy: get the content from other storage server, then send to client
8282
## redirect: redirect to the original storage server (HTTP Header is Location)
83-
response_mode=proxy
83+
response_mode = proxy
8484

8585
# the NIC alias prefix, such as eth in Linux, you can see it by ifconfig -a
8686
# multi aliases split by comma. empty value means auto set by OS type
8787
# this paramter used to get all ip address of the local host
8888
# default values is empty
89-
if_alias_prefix=
89+
if_alias_prefix =
9090

9191
# use "#include" directive to include HTTP config file
9292
# NOTE: #include is an include directive, do NOT remove the # before include
@@ -129,5 +129,4 @@ group_count = 0
129129
#group_name=group2
130130
#storage_server_port=23000
131131
#store_path_count=1
132-
#store_path0=/home/yuqing/fastdfs
133-
132+
#store_path0=/home/yuqing/fastdfs

0 commit comments

Comments
 (0)