Skip to content

Commit 22d871e

Browse files
committed
Introduce /entrypoint.d and /entrypoint.cmd
1 parent bfb767c commit 22d871e

File tree

24 files changed

+216
-84
lines changed

24 files changed

+216
-84
lines changed

docker/base/alpine-3/conf/bin/config.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ function replaceTextInFile() {
6060
#
6161
##
6262
function includeScriptDir() {
63-
for FILE in "$1"/*.sh; do
64-
# run custom scripts, only once
65-
. "$FILE"
66-
done
63+
if [[ -d "$1" ]]; then
64+
for FILE in "$1"/*.sh; do
65+
# run custom scripts, only once
66+
. "$FILE"
67+
done
68+
fi
6769
}
6870

6971
###
@@ -144,6 +146,7 @@ function runProvisionOnBuild() {
144146
##
145147
function runProvisionEntrypoint() {
146148
includeScriptDir "/opt/docker/provision/entrypoint.d"
149+
includeScriptDir "/entrypoint.d"
147150

148151
runDockerProvision entrypoint
149152
}
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
---
22

3-
- name: Register logrotate configurations
3+
- name: Create /entrypoint.d
44
file:
5-
src: '/opt/docker/provision/entrypoint.d'
6-
dest: '/entrypoint.d'
5+
path: "/entrypoint.d"
6+
state: directory
7+
owner: "root"
8+
group: "root"
9+
mode: 0700
10+
11+
- name: Create /entrypoint.cmd
12+
file:
13+
src: '/opt/docker/bin/entrypoint.d'
14+
dest: '/entrypoint.cmd'
715
state: link
816
force: yes

docker/base/centos-7/conf/bin/config.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ function replaceTextInFile() {
6060
#
6161
##
6262
function includeScriptDir() {
63-
for FILE in "$1"/*.sh; do
64-
# run custom scripts, only once
65-
. "$FILE"
66-
done
63+
if [[ -d "$1" ]]; then
64+
for FILE in "$1"/*.sh; do
65+
# run custom scripts, only once
66+
. "$FILE"
67+
done
68+
fi
6769
}
6870

6971
###
@@ -144,6 +146,7 @@ function runProvisionOnBuild() {
144146
##
145147
function runProvisionEntrypoint() {
146148
includeScriptDir "/opt/docker/provision/entrypoint.d"
149+
includeScriptDir "/entrypoint.d"
147150

148151
runDockerProvision entrypoint
149152
}
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
---
22

3-
- name: Register logrotate configurations
3+
- name: Create /entrypoint.d
44
file:
5-
src: '/opt/docker/provision/entrypoint.d'
6-
dest: '/entrypoint.d'
5+
path: "/entrypoint.d"
6+
state: directory
7+
owner: "root"
8+
group: "root"
9+
mode: 0700
10+
11+
- name: Create /entrypoint.cmd
12+
file:
13+
src: '/opt/docker/bin/entrypoint.d'
14+
dest: '/entrypoint.cmd'
715
state: link
816
force: yes

docker/base/debian-7/conf/bin/config.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ function replaceTextInFile() {
6060
#
6161
##
6262
function includeScriptDir() {
63-
for FILE in "$1"/*.sh; do
64-
# run custom scripts, only once
65-
. "$FILE"
66-
done
63+
if [[ -d "$1" ]]; then
64+
for FILE in "$1"/*.sh; do
65+
# run custom scripts, only once
66+
. "$FILE"
67+
done
68+
fi
6769
}
6870

6971
###
@@ -144,6 +146,7 @@ function runProvisionOnBuild() {
144146
##
145147
function runProvisionEntrypoint() {
146148
includeScriptDir "/opt/docker/provision/entrypoint.d"
149+
includeScriptDir "/entrypoint.d"
147150

148151
runDockerProvision entrypoint
149152
}
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
---
22

3-
- name: Register logrotate configurations
3+
- name: Create /entrypoint.d
44
file:
5-
src: '/opt/docker/provision/entrypoint.d'
6-
dest: '/entrypoint.d'
5+
path: "/entrypoint.d"
6+
state: directory
7+
owner: "root"
8+
group: "root"
9+
mode: 0700
10+
11+
- name: Create /entrypoint.cmd
12+
file:
13+
src: '/opt/docker/bin/entrypoint.d'
14+
dest: '/entrypoint.cmd'
715
state: link
816
force: yes

docker/base/debian-8/conf/bin/config.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ function replaceTextInFile() {
6060
#
6161
##
6262
function includeScriptDir() {
63-
for FILE in "$1"/*.sh; do
64-
# run custom scripts, only once
65-
. "$FILE"
66-
done
63+
if [[ -d "$1" ]]; then
64+
for FILE in "$1"/*.sh; do
65+
# run custom scripts, only once
66+
. "$FILE"
67+
done
68+
fi
6769
}
6870

6971
###
@@ -144,6 +146,7 @@ function runProvisionOnBuild() {
144146
##
145147
function runProvisionEntrypoint() {
146148
includeScriptDir "/opt/docker/provision/entrypoint.d"
149+
includeScriptDir "/entrypoint.d"
147150

148151
runDockerProvision entrypoint
149152
}
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
---
22

3-
- name: Register logrotate configurations
3+
- name: Create /entrypoint.d
44
file:
5-
src: '/opt/docker/provision/entrypoint.d'
6-
dest: '/entrypoint.d'
5+
path: "/entrypoint.d"
6+
state: directory
7+
owner: "root"
8+
group: "root"
9+
mode: 0700
10+
11+
- name: Create /entrypoint.cmd
12+
file:
13+
src: '/opt/docker/bin/entrypoint.d'
14+
dest: '/entrypoint.cmd'
715
state: link
816
force: yes

docker/base/debian-9/conf/bin/config.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ function replaceTextInFile() {
6060
#
6161
##
6262
function includeScriptDir() {
63-
for FILE in "$1"/*.sh; do
64-
# run custom scripts, only once
65-
. "$FILE"
66-
done
63+
if [[ -d "$1" ]]; then
64+
for FILE in "$1"/*.sh; do
65+
# run custom scripts, only once
66+
. "$FILE"
67+
done
68+
fi
6769
}
6870

6971
###
@@ -144,6 +146,7 @@ function runProvisionOnBuild() {
144146
##
145147
function runProvisionEntrypoint() {
146148
includeScriptDir "/opt/docker/provision/entrypoint.d"
149+
includeScriptDir "/entrypoint.d"
147150

148151
runDockerProvision entrypoint
149152
}
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
---
22

3-
- name: Register logrotate configurations
3+
- name: Create /entrypoint.d
44
file:
5-
src: '/opt/docker/provision/entrypoint.d'
6-
dest: '/entrypoint.d'
5+
path: "/entrypoint.d"
6+
state: directory
7+
owner: "root"
8+
group: "root"
9+
mode: 0700
10+
11+
- name: Create /entrypoint.cmd
12+
file:
13+
src: '/opt/docker/bin/entrypoint.d'
14+
dest: '/entrypoint.cmd'
715
state: link
816
force: yes

0 commit comments

Comments
 (0)