Skip to content

Commit 5123585

Browse files
committed
Merge branch 'hotfix-0.6.11' into stable
2 parents 325b325 + 4942218 commit 5123585

File tree

11 files changed

+64
-88
lines changed

11 files changed

+64
-88
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## 0.6.11
4+
- Upgrade baseimage: web-baseimage:0.1.10
5+
36
## 0.6.10
47
- Add PHPLDAPADMIN_SERVER_PATH environment variable
58

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NAME = osixia/phpldapadmin
2-
VERSION = 0.6.10
2+
VERSION = 0.6.11
33

44
.PHONY: all build build-nocache test tag_latest release
55

@@ -15,7 +15,7 @@ test:
1515
env NAME=$(NAME) VERSION=$(VERSION) bats test/test.bats
1616

1717
tag_latest:
18-
docker tag -f $(NAME):$(VERSION) $(NAME):latest
18+
docker tag $(NAME):$(VERSION) $(NAME):latest
1919

2020
release: build test tag_latest
2121
@if ! docker images $(NAME) | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME) version $(VERSION) is not yet built. Please run 'make build'"; false; fi

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
[hub]: https://hub.docker.com/r/osixia/phpldapadmin/
77

8-
Latest release: 0.6.10 - phpLDAPadlin 1.2.3 (with php5.5 patch) - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/phpldapadmin/) 
8+
Latest release: 0.6.11 - phpLDAPadlin 1.2.3 (with php5.5 patch) - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/phpldapadmin/) 
99

1010
A docker image to run phpLDAPadmin.
1111
> [phpldapadmin.sourceforge.net](http://phpldapadmin.sourceforge.net)
@@ -26,7 +26,7 @@ A docker image to run phpLDAPadmin.
2626
- [Link environment file](#link-environment-file)
2727
- [Make your own image or extend this image](#make-your-own image-or-extend-this-image)
2828
- [Advanced User Guide](#advanced-user-guide)
29-
- [Extend osixia/phpldapadmin:0.6.10 image](#extend-osixiaphpldapadmin0610-image)
29+
- [Extend osixia/phpldapadmin:0.6.11 image](#extend-osixiaphpldapadmin0611-image)
3030
- [Make your own phpLDAPadmin image](#make-your-own-phpldapadmin-image)
3131
- [Tests](#tests)
3232
- [Kubernetes](#kubernetes)
@@ -39,7 +39,7 @@ Run a phpLDAPadmin docker image by replacing `ldap.example.com` with your ldap h
3939

4040
docker run -p 6443:443 \
4141
--env PHPLDAPADMIN_LDAP_HOSTS=ldap.example.com \
42-
--detach osixia/phpldapadmin:0.6.10
42+
--detach osixia/phpldapadmin:0.6.11
4343

4444
That's it :) you can access phpLDAPadmin on [https://localhost:6443](https://localhost:6443)
4545

@@ -50,7 +50,7 @@ Example script:
5050
#!/bin/bash -e
5151
docker run --name ldap-service --hostname ldap-service --detach osixia/openldap:1.1.1
5252

53-
docker run --name phpldapadmin-service --hostname phpldapadmin-service --link ldap-service:ldap-host --env PHPLDAPADMIN_LDAP_HOSTS=ldap-host --detach osixia/phpldapadmin:0.6.10
53+
docker run --name phpldapadmin-service --hostname phpldapadmin-service --link ldap-service:ldap-host --env PHPLDAPADMIN_LDAP_HOSTS=ldap-host --detach osixia/phpldapadmin:0.6.11
5454

5555
PHPLDAP_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" phpldapadmin-service)
5656

@@ -67,7 +67,7 @@ but setting your own config.php is possible. 2 options:
6767

6868
- Link your config file at run time to `/container/service/phpldapadmin/assets/config.php` :
6969

70-
docker run --volume /data/my-config.php:/container/service/phpldapadmin/assets/config.php --detach osixia/phpldapadmin:0.6.10
70+
docker run --volume /data/my-config.php:/container/service/phpldapadmin/assets/config.php --detach osixia/phpldapadmin:0.6.11
7171

7272
- Add your config file by extending or cloning this image, please refer to the [Advanced User Guide](#advanced-user-guide)
7373

@@ -76,7 +76,7 @@ but setting your own config.php is possible. 2 options:
7676
#### Use autogenerated certificate
7777
By default HTTPS is enable, a certificate is created with the container hostname (it can be set by docker run --hostname option eg: phpldapadmin.my-company.com).
7878

79-
docker run --hostname phpldapadmin.my-company.com --detach osixia/phpldapadmin:0.6.10
79+
docker run --hostname phpldapadmin.my-company.com --detach osixia/phpldapadmin:0.6.11
8080

8181
#### Use your own certificate
8282

@@ -86,22 +86,22 @@ You can set your custom certificate at run time, by mounting a directory contain
8686
--env PHPLDAPADMIN_HTTPS_CRT_FILENAME=my-cert.crt \
8787
--env PHPLDAPADMIN_HTTPS_KEY_FILENAME=my-cert.key \
8888
--env PHPLDAPADMIN_HTTPS_CA_CRT_FILENAME=the-ca.crt \
89-
--detach osixia/phpldapadmin:0.6.10
89+
--detach osixia/phpldapadmin:0.6.11
9090

9191
Other solutions are available please refer to the [Advanced User Guide](#advanced-user-guide)
9292

9393
#### Disable HTTPS
9494
Add --env PHPLDAPADMIN_HTTPS=false to the run command :
9595

96-
docker run --env PHPLDAPADMIN_HTTPS=false --detach osixia/phpldapadmin:0.6.10
96+
docker run --env PHPLDAPADMIN_HTTPS=false --detach osixia/phpldapadmin:0.6.11
9797

9898
### Fix docker mounted file problems
9999

100100
You may have some problems with mounted files on some systems. The startup script try to make some file adjustment and fix files owner and permissions, this can result in multiple errors. See [Docker documentation](https://docs.docker.com/v1.4/userguide/dockervolumes/#mount-a-host-file-as-a-data-volume).
101101

102102
To fix that run the container with `--copy-service` argument :
103103

104-
docker run [your options] osixia/phpldapadmin:0.6.10 --copy-service
104+
docker run [your options] osixia/phpldapadmin:0.6.11 --copy-service
105105

106106
### Debug
107107

@@ -110,11 +110,11 @@ Available levels are: `none`, `error`, `warning`, `info`, `debug` and `trace`.
110110

111111
Example command to run the container in `debug` mode:
112112

113-
docker run --detach osixia/phpldapadmin:0.6.10 --loglevel debug
113+
docker run --detach osixia/phpldapadmin:0.6.11 --loglevel debug
114114

115115
See all command line options:
116116

117-
docker run osixia/phpldapadmin:0.6.10 --help
117+
docker run osixia/phpldapadmin:0.6.11 --help
118118

119119
## Environment Variables
120120

@@ -167,7 +167,7 @@ See how to [set your own environment variables](#set-your-own-environment-variab
167167
168168
If you want to set this variable at docker run command add the tag `#PYTHON2BASH:` and convert the yaml in python:
169169

170-
docker run --env PHPLDAPADMIN_LDAP_HOSTS="#PYTHON2BASH:[{'ldap.example.org': [{'server': [{'tls': True}]},{'login': [{'bind_id': 'cn=admin,dc=example,dc=org'}]}]}, 'ldap2.example.org', 'ldap3.example.org']" --detach osixia/phpldapadmin:0.6.10
170+
docker run --env PHPLDAPADMIN_LDAP_HOSTS="#PYTHON2BASH:[{'ldap.example.org': [{'server': [{'tls': True}]},{'login': [{'bind_id': 'cn=admin,dc=example,dc=org'}]}]}, 'ldap2.example.org', 'ldap3.example.org']" --detach osixia/phpldapadmin:0.6.11
171171

172172
To convert yaml to python online: http://yaml-online-parser.appspot.com/
173173

@@ -195,23 +195,23 @@ Ldap client TLS/LDAPS :
195195
More information at : http://www.openldap.org/doc/admin24/tls.html (16.2.2. Client Configuration)
196196

197197
Other environment variables:
198-
- **PHPLDAPADMIN_CFSSL_PREFIX**: cfssl environment variables prefix. Defaults to `phpldapadmin`, cfssl-helper first search config from PHPLDAPADMIN_CFSSL_* variables, before CFSSL_* variables.
199-
- **LDAP_CLIENT_CFSSL_PREFIX**: cfssl environment variables prefix. Defaults to `ldap`, cfssl-helper first search config from LDAP_CFSSL_* variables, before CFSSL_* variables.
198+
- **PHPLDAPADMIN_SSL_HELPER_PREFIX**: ssl-helper environment variables prefix. Defaults to `phpldapadmin`, ssl-helper first search config from PHPLDAPADMIN_SSL_HELPER_* variables, before SSL_HELPER_* variables.
199+
- **LDAP_CLIENT_SSL_HELPER_PREFIX**: ssl-helper environment variables prefix. Defaults to `ldap`, ssl-helper first search config from LDAP_SSL_HELPER_* variables, before SSL_HELPER_* variables.
200200

201201
### Set your own environment variables
202202

203203
#### Use command line argument
204204
Environment variables can be set by adding the --env argument in the command line, for example:
205205

206206
docker run --env PHPLDAPADMIN_LDAP_HOSTS="ldap.example.org" \
207-
--detach osixia/phpldapadmin:0.6.10
207+
--detach osixia/phpldapadmin:0.6.11
208208

209209
#### Link environment file
210210

211211
For example if your environment file is in : /data/environment/my-env.yaml
212212

213213
docker run --volume /data/environment/my-env.yaml:/container/environment/01-custom/env.yaml \
214-
--detach osixia/phpldapadmin:0.6.10
214+
--detach osixia/phpldapadmin:0.6.11
215215

216216
Take care to link your environment file to `/container/environment/XX-somedir` (with XX < 99 so they will be processed before default environment files) and not directly to `/container/environment` because this directory contains predefined baseimage environment files to fix container environment (INITRD, LANG, LANGUAGE and LC_CTYPE).
217217

@@ -221,13 +221,13 @@ This is the best solution if you have a private registry. Please refer to the [A
221221

222222
## Advanced User Guide
223223

224-
### Extend osixia/phpldapadmin:0.6.10 image
224+
### Extend osixia/phpldapadmin:0.6.11 image
225225

226226
If you need to add your custom TLS certificate, bootstrap config or environment files the easiest way is to extends this image.
227227

228228
Dockerfile example:
229229

230-
FROM osixia/phpldapadmin:0.6.10
230+
FROM osixia/phpldapadmin:0.6.11
231231
MAINTAINER Your Name <[email protected]>
232232

233233
ADD https-certs /container/service/phpldapadmin/assets/apache2/certs
@@ -249,7 +249,7 @@ Clone this project :
249249
Adapt Makefile, set your image NAME and VERSION, for example :
250250

251251
NAME = osixia/phpldapadmin
252-
VERSION = 0.6.10
252+
VERSION = 0.6.11
253253

254254
becomes :
255255
NAME = billy-the-king/phpldapadmin

example/kubernetes/phpldapadmin-rc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
spec:
1616
containers:
1717
- name: phpldapadmin
18-
image: osixia/phpldapadmin:0.6.10
18+
image: osixia/phpldapadmin:0.6.11
1919
volumeMounts:
2020
- name: phpldapadmin-certs
2121
mountPath: /container/service/phpldapadmin/assets/apache2/certs

image/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM osixia/web-baseimage:0.1.10
1+
FROM osixia/web-baseimage:0.1.11
22
MAINTAINER Bertrand Gouny <[email protected]>
33

44
# phpLDAPadmin version
@@ -10,13 +10,13 @@ ENV PHPLDAPADMIN_SHA1 669fca66c75e24137e106fdd02e3832f81146e23
1010
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/add-service-available
1111
#  https://github.com/osixia/docker-web-baseimage/blob/stable/image/service-available/:apache2/download.sh
1212
# https://github.com/osixia/docker-web-baseimage/blob/stable/image/service-available/:php5-fpm/download.sh
13-
# https://github.com/osixia/docker-web-baseimage/blob/stable/image/service-available/:cfssl/download.sh
13+
# https://github.com/osixia/light-baseimage/blob/stable/image/service-available/:ssl-tools/download.sh
1414
# Install ca-certificates, curl and php dependencies
1515
# Download phpLDAPadmin, check file integrity, and unzip phpLDAPadmin to /var/www/phpldapadmin_bootstrap
1616
# Remove curl
1717
RUN apt-get update \
1818
&& /container/tool/add-multiple-process-stack \
19-
&& /container/tool/add-service-available :apache2 :php5-fpm :cfssl \
19+
&& /container/tool/add-service-available :apache2 :php5-fpm :ssl-tools \
2020
&& LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes --no-install-recommends \
2121
ca-certificates \
2222
curl \
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
PHPLDAPADMIN_LDAP_HOSTS:
2+
- ldap.example.org:
3+
- server:
4+
- tls: true
5+
- login:
6+
- bind_id: cn=admin,dc=example,dc=org
7+
- ldap2.example.org
8+
- ldap3.example.org
9+
10+
# LDAP client tls config
11+
PHPLDAPADMIN_LDAP_CLIENT_TLS: true
12+
PHPLDAPADMIN_LDAP_CLIENT_TLS_REQCERT: demand
13+
PHPLDAPADMIN_LDAP_CLIENT_TLS_CA_CRT_FILENAME: ldap-ca.crt
14+
PHPLDAPADMIN_LDAP_CLIENT_TLS_CRT_FILENAME: ldap-client.crt
15+
PHPLDAPADMIN_LDAP_CLIENT_TLS_KEY_FILENAME: ldap-client.key
16+
17+
# ssl-helper environment variables prefix
18+
LDAP_CLIENT_SSL_HELPER_PREFIX: ldap # ssl-helper first search config from LDAP_SSL_HELPER_* variables, before SSL_HELPER_* variables.
19+
20+
SSL_HELPER_AUTO_RENEW_SERVICES_IMPACTED: :apache2 :php5-fpm

image/environment/default.yaml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
PHPLDAPADMIN_LDAP_HOSTS:
2-
- ldap.example.org:
3-
- server:
4-
- tls: true
5-
- login:
6-
- bind_id: cn=admin,dc=example,dc=org
7-
- ldap2.example.org
8-
- ldap3.example.org
9-
101
# Apache
112
PHPLDAPADMIN_SERVER_ADMIN: [email protected]
123
PHPLDAPADMIN_SERVER_PATH: /phpldapadmin
@@ -22,13 +13,7 @@ PHPLDAPADMIN_HTTPS_CRT_FILENAME: phpldapadmin.crt
2213
PHPLDAPADMIN_HTTPS_KEY_FILENAME: phpldapadmin.key
2314
PHPLDAPADMIN_HTTPS_CA_CRT_FILENAME: ca.crt
2415

25-
# LDAP client tls config
26-
PHPLDAPADMIN_LDAP_CLIENT_TLS: true
27-
PHPLDAPADMIN_LDAP_CLIENT_TLS_REQCERT: demand
28-
PHPLDAPADMIN_LDAP_CLIENT_TLS_CA_CRT_FILENAME: ldap-ca.crt
29-
PHPLDAPADMIN_LDAP_CLIENT_TLS_CRT_FILENAME: ldap-client.crt
30-
PHPLDAPADMIN_LDAP_CLIENT_TLS_KEY_FILENAME: ldap-client.key
16+
PHPLDAPADMIN_TRUST_PROXY_SSL: false
3117

32-
# cfssl environment variables prefix
33-
PHPLDAPADMIN_CFSSL_PREFIX: phpldapadmin # cfssl-helper first search config from PHPLDAPADMIN_CFSSL_* variables, before CFSSL_* variables.
34-
LDAP_CLIENT_CFSSL_PREFIX: ldap # cfssl-helper first search config from LDAP_CFSSL_* variables, before CFSSL_* variables.
18+
# ssl-helper environment variables prefix
19+
PHPLDAPADMIN_SSL_HELPER_PREFIX: phpldapadmin # ssl-helper first search config from PHPLDAPADMIN_SSL_HELPER_* variables, before SSL_HELPER_* variables.

image/service/ldap-client/startup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ if [ ! -e "$FIRST_START_DONE" ]; then
1313
if [ "${PHPLDAPADMIN_LDAP_CLIENT_TLS,,}" == "true" ]; then
1414

1515
# generate a certificate and key if files don't exists
16-
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/service-available/:cfssl/assets/tool/cfssl-helper
17-
cfssl-helper ${LDAP_CLIENT_CFSSL_PREFIX} "${CONTAINER_SERVICE_DIR}/ldap-client/assets/certs/${PHPLDAPADMIN_LDAP_CLIENT_TLS_CRT_FILENAME}" "${CONTAINER_SERVICE_DIR}/ldap-client/assets/certs/${PHPLDAPADMIN_LDAP_CLIENT_TLS_KEY_FILENAME}" "${CONTAINER_SERVICE_DIR}/ldap-client/assets/certs/${PHPLDAPADMIN_LDAP_CLIENT_TLS_CA_CRT_FILENAME}"
16+
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/service-available/:ssl-tools/assets/tool/ssl-helper
17+
ssl-helper ${LDAP_CLIENT_SSL_HELPER_PREFIX} "${CONTAINER_SERVICE_DIR}/ldap-client/assets/certs/${PHPLDAPADMIN_LDAP_CLIENT_TLS_CRT_FILENAME}" "${CONTAINER_SERVICE_DIR}/ldap-client/assets/certs/${PHPLDAPADMIN_LDAP_CLIENT_TLS_KEY_FILENAME}" "${CONTAINER_SERVICE_DIR}/ldap-client/assets/certs/${PHPLDAPADMIN_LDAP_CLIENT_TLS_CA_CRT_FILENAME}"
1818

1919
# ldap client config
2020
sed -i --follow-symlinks "s,TLS_CACERT.*,TLS_CACERT ${CONTAINER_SERVICE_DIR}/ldap-client/assets/certs/${PHPLDAPADMIN_LDAP_CLIENT_TLS_CA_CRT_FILENAME},g" /etc/ldap/ldap.conf

image/service/phpldapadmin/startup.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ if [ "${PHPLDAPADMIN_HTTPS,,}" == "true" ]; then
1414
log-helper info "Set apache2 https config..."
1515

1616
# generate a certificate and key if files don't exists
17-
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/service-available/:cfssl/assets/tool/cfssl-helper
18-
cfssl-helper ${PHPLDAPADMIN_CFSSL_PREFIX} "${CONTAINER_SERVICE_DIR}/phpldapadmin/assets/apache2/certs/$PHPLDAPADMIN_HTTPS_CRT_FILENAME" "${CONTAINER_SERVICE_DIR}/phpldapadmin/assets/apache2/certs/$PHPLDAPADMIN_HTTPS_KEY_FILENAME" "${CONTAINER_SERVICE_DIR}/phpldapadmin/assets/apache2/certs/$PHPLDAPADMIN_HTTPS_CA_CRT_FILENAME"
17+
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/service-available/:ssl-tools/assets/tool/ssl-helper
18+
ssl-helper ${PHPLDAPADMIN_SSL_HELPER_PREFIX} "${CONTAINER_SERVICE_DIR}/phpldapadmin/assets/apache2/certs/$PHPLDAPADMIN_HTTPS_CRT_FILENAME" "${CONTAINER_SERVICE_DIR}/phpldapadmin/assets/apache2/certs/$PHPLDAPADMIN_HTTPS_KEY_FILENAME" "${CONTAINER_SERVICE_DIR}/phpldapadmin/assets/apache2/certs/$PHPLDAPADMIN_HTTPS_CA_CRT_FILENAME"
1919

2020
# add CA certificat config if CA cert exists
2121
if [ -e "${CONTAINER_SERVICE_DIR}/phpldapadmin/assets/apache2/certs/$PHPLDAPADMIN_HTTPS_CA_CRT_FILENAME" ]; then
@@ -43,7 +43,7 @@ a2ensite phpldapadmin | log-helper debug
4343
#
4444
# phpLDAPadmin directory is empty, we use the bootstrap
4545
#
46-
if [ ! "$(ls -A /var/www/phpldapadmin)" ]; then
46+
if [ ! "$(ls -A -I lost+found /var/www/phpldapadmin)" ]; then
4747

4848
log-helper info "Bootstap phpLDAPadmin..."
4949

test/test.bats

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ load test_helper
1313
tmp_file="$BATS_TMPDIR/docker-test"
1414

1515
run_image
16-
wait_service apache2 php5-fpm
16+
wait_process apache2 php5-fpm
1717
curl --silent --insecure https://$CONTAINER_IP >> $tmp_file
1818
run grep -c "Use the menu to the left to navigate" $tmp_file
1919
rm $tmp_file
@@ -29,17 +29,17 @@ load test_helper
2929
tmp_file="$BATS_TMPDIR/docker-test"
3030

3131
# we start a new openldap container
32-
LDAP_CID=$(docker run -d osixia/openldap:1.1.1)
32+
LDAP_CID=$(docker run -d osixia/openldap:1.1.6)
3333
LDAP_IP=$(get_container_ip_by_cid $LDAP_CID)
3434

3535
# we start the wordpress container and set DB_HOSTS
3636
run_image -e PHPLDAPADMIN_LDAP_HOSTS=$LDAP_IP
3737

3838
# wait openldap
39-
wait_service_by_cid $LDAP_CID slapd
39+
wait_process_by_cid $LDAP_CID slapd
4040

4141
# wait phpLDAPadmin container apache2 service
42-
wait_service apache2 php5-fpm
42+
wait_process apache2 php5-fpm
4343

4444
curl -L --silent --insecure -c $BATS_TMPDIR/cookie.txt https://$CONTAINER_IP >> $tmp_file
4545

test/test_helper.bash

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,10 @@ clear_container() {
3030
remove_containers_by_cid $CONTAINER_ID
3131
}
3232

33-
is_service_running() {
34-
is_service_running_by_cid $CONTAINER_ID $1
33+
wait_process() {
34+
wait_process_by_cid $CONTAINER_ID $@
3535
}
3636

37-
is_file_exists() {
38-
is_file_exists_by_cid $CONTAINER_ID $1
39-
}
40-
41-
wait_service() {
42-
wait_service_by_cid $CONTAINER_ID $@
43-
}
44-
45-
4637
# generic functions
4738
get_container_ip_by_cid() {
4839
local IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" $1)
@@ -78,30 +69,7 @@ clear_containers_by_cid() {
7869
remove_containers_by_cid $@
7970
}
8071

81-
is_service_running_by_cid() {
82-
docker exec $1 ps cax | grep $2 > /dev/null
83-
}
84-
85-
is_file_exists_by_cid() {
86-
docker exec $1 cat $2 > /dev/null 2>&1
87-
}
88-
89-
wait_service_by_cid() {
90-
72+
wait_process_by_cid() {
9173
cid=$1
92-
93-
# first wait image init end
94-
while ! is_file_exists_by_cid $cid /container/run/state/startup-done
95-
do
96-
sleep 0.5
97-
done
98-
99-
for service in "${@:2}"
100-
do
101-
# wait service
102-
while ! is_service_running_by_cid $cid $service
103-
do
104-
sleep 0.5
105-
done
106-
done
74+
docker exec $cid /container/tool/wait-process ${@:2}
10775
}

0 commit comments

Comments
 (0)