File tree 9 files changed +39
-23
lines changed
9 files changed +39
-23
lines changed Original file line number Diff line number Diff line change
1
+ # 1.1.7
2
+
3
+ - [ build] ( Dockerfile ) Switch to php82 and make it a build argument: ` --build-arg PHP_VER=php82 ` .
4
+ - [ build] ( Makefile ) Now set ` DOCKER_BUILDKIT=1 ` since we don't use special symbolic links.
5
+ - [ docker] ( src/docker ) Improve debug message in [ docker-service.sh] ( src/docker/bin/docker-service.sh ) .
6
+
1
7
# 1.1.6
2
8
3
9
- [ build] ( Makefile ) Now use alpine:3.18 (asterisk:18.15.1).
Original file line number Diff line number Diff line change 1
- ARG DIST=alpine
2
- ARG REL=latest
1
+ ARG DIST=alpine
2
+ ARG REL=latest
3
3
4
4
5
5
#
@@ -11,14 +11,16 @@ ARG REL=latest
11
11
#
12
12
13
13
FROM $DIST:$REL AS mini
14
+ ARG PHP_VER=php82
14
15
LABEL maintainer=mlan
15
16
16
- ENV SVDIR=/etc/service \
17
+ ENV PHP_VER=$PHP_VER \
18
+ SVDIR=/etc/service \
17
19
DOCKER_PERSIST_DIR=/srv \
18
20
DOCKER_BIN_DIR=/usr/local/bin \
19
21
DOCKER_ENTRY_DIR=/etc/docker/entry.d \
20
22
DOCKER_EXIT_DIR=/etc/docker/exit.d \
21
- DOCKER_PHP_DIR=/usr/share/php81 \
23
+ DOCKER_PHP_DIR=/usr/share/$PHP_VER \
22
24
DOCKER_SPOOL_DIR=/var/spool/asterisk \
23
25
DOCKER_CONF_DIR=/etc/asterisk \
24
26
DOCKER_LOG_DIR=/var/log/asterisk \
@@ -62,6 +64,8 @@ RUN source docker-common.sh \
62
64
$DOCKER_NFT_DIR \
63
65
$DOCKER_SPOOL_DIR \
64
66
&& mkdir -p $DOCKER_ACME_SSL_DIR \
67
+ && ln -sf $DOCKER_PHP_DIR/autoban.php $DOCKER_BIN_DIR/autoban \
68
+ && ln -sf $DOCKER_PHP_DIR/websms.php $DOCKER_BIN_DIR/websms \
65
69
&& apk --no-cache --update add \
66
70
asterisk
67
71
@@ -93,13 +97,14 @@ RUN apk --no-cache --update add \
93
97
asterisk-srtp \
94
98
openssl \
95
99
curl \
96
- php81 \
97
- php81 -curl \
98
- php81 -json \
100
+ $PHP_VER \
101
+ $PHP_VER -curl \
102
+ $PHP_VER -json \
99
103
runit \
100
104
bash \
101
105
nftables \
102
106
jq \
107
+ && ln -sf /usr/bin/$PHP_VER /usr/bin/php \
103
108
&& docker-service.sh \
104
109
"syslogd -nO- -l$SYSLOG_LEVEL $SYSLOG_OPTIONS" \
105
110
"crond -f -c /etc/crontabs" \
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ BLD_TGTS ?= mini base full xtra
13
13
BLD_CMT ?= HEAD
14
14
BLD_CVER ?= ast160
15
15
BLD_DNLD ?= curl -o
16
- BLD_KIT ?= DOCKER_BUILDKIT=0
16
+ BLD_KIT ?= DOCKER_BUILDKIT=1
17
17
18
18
TST_REPO ?= $(BLD_REPO )
19
19
TST_VER ?= $(BLD_VER )
79
79
docker image prune -f
80
80
81
81
clean :
82
- docker images | grep $(BLD_REPO ) | awk ' {print $$1 ":" $$2}' | uniq | xargs docker rmi
82
+ docker images | grep $(BLD_REPO ) | awk ' {print $$1 ":" $$2}' | uniq | xargs docker rmi || true
83
83
84
84
$(TST_TGTE ) :
85
85
${MAKE} $(TST_ENV ) $@
Original file line number Diff line number Diff line change @@ -116,10 +116,11 @@ tools_install:
116
116
pulseaudio-utils alsa-utils
117
117
118
118
xdebug_install :
119
+ $(eval PHP_VER=$(shell docker compose exec $(SRV_NAME ) sh -c 'echo $$PHP_VER') )
119
120
docker compose exec $(SRV_NAME ) apk --no-cache --update add \
120
- php8 -pecl-xdebug
121
- docker compose exec $(SRV_NAME ) sed -i ' 1 a xdebug.profiler_enable = 1' /etc/php81 /php.ini
122
- docker compose exec $(SRV_NAME ) sed -i ' 2 a zend_extension=xdebug.so' /etc/php81 /conf.d/50_xdebug.ini
121
+ $( PHP_VER ) -pecl-xdebug
122
+ docker compose exec $(SRV_NAME ) sed -i ' 1 a xdebug.profiler_enable = 1' /etc/$( PHP_VER ) /php.ini
123
+ docker compose exec $(SRV_NAME ) sed -i ' 2 a zend_extension=xdebug.so' /etc/$( PHP_VER ) /conf.d/50_xdebug.ini
123
124
docker compose exec $(SRV_NAME ) sv restart websmsd autoband
124
125
125
126
xdebug_getdata :
Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ dkr_cnt_pid = $(shell docker inspect --format '{{.State.Pid}}' $(1))
28
28
# '{{range .NetworkSettings.Networks}}{{println .IPAddress}}{{end}}' \
29
29
# $(1) | head -n1)
30
30
31
+ #
32
+ # $(call dkr_img_env,image,envvar) -> value
33
+ #
34
+ dkr_img_env = $(shell docker inspect -f \
35
+ '{{range .Config.Env}}{{println .}}{{end}}' $(1 ) | grep -P "^$(2 ) =" | sed 's/[^=]* =//'
31
36
#
32
37
# List IPs of containers
33
38
#
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -75,24 +75,25 @@ init_service() {
75
75
esac
76
76
done
77
77
shift $(( OPTIND - 1 ))
78
- cmd=$( which " $1 " )
79
- sv_name=${sv_name-$(base_name $1 )}
78
+ cmd=$1
79
+ cmd_path=$( which " $cmd " )
80
+ sv_name=${sv_name-$(base_name $cmd )}
80
81
runsv_dir=$SVDIR /$sv_name
81
82
svlog_dir=$DOCKER_SVLOG_DIR /$sv_name
82
83
if [ -n " $sv_force " ]; then
83
84
forcepid=" $( echo rm -f $( pid_name $sv_name ) * ) "
84
85
fi
85
86
shift
86
- if [ ! -z " $cmd " ]; then
87
- dc_log 5 " Setting up ($sv_name ) options ($options ) args ($@ )"
87
+ if [ ! -z " $cmd_path " ]; then
88
+ dc_log 5 " Setting up ($sv_name ) options ($options ) cmd ( $cmd_path ) args ($@ )"
88
89
mkdir -p $runsv_dir
89
90
cat << -!cat > $runsv_dir /run
90
91
#!/bin/sh -e
91
92
exec 2>&1
92
93
$forcepid
93
94
$redirstd
94
95
$sourcefile
95
- exec $cmd $@
96
+ exec $cmd_path $@
96
97
!cat
97
98
chmod +x $runsv_dir /run
98
99
if [ -n " $sv_down " ]; then
@@ -107,14 +108,14 @@ init_service() {
107
108
chmod +x $runsv_dir /log/run
108
109
fi
109
110
else
110
- dc_log 4 " Cannot find command. "
111
+ dc_log 4 " Cannot find command: $cmd "
111
112
fi
112
113
}
113
114
114
115
#
115
116
# run
116
117
#
117
118
118
- for cmd in " $@ " ; do
119
- init_service $cmd
119
+ for args in " $@ " ; do
120
+ init_service $args
120
121
done
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ test-logs_%:
115
115
docker container logs $(PBX_NAME ) | grep ' docker-entrypoint.sh' || true
116
116
117
117
test-wait_% :
118
- case $* in [1-3 ]) sleep $( TST_W8S) ;; [4 -9]) sleep $( TST_W8L) ;; esac
118
+ case $* in [1-2 ]) sleep $( TST_W8S) ;; [3 -9]) sleep $( TST_W8L) ;; esac
119
119
120
120
test-up-net :
121
121
docker network create $(NET_NAME ) 2> /dev/null || true
You can’t perform that action at this time.
0 commit comments