Skip to content

Commit 9ef05f8

Browse files
committed
Exec Bash just after sourcing stolon env
1 parent aa228da commit 9ef05f8

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ RUN useradd -ms /bin/bash stolon
5656
RUN mkdir -p /run/haproxy/
5757
COPY --from=flyutil /fly/bin/* /usr/local/bin/
5858

59-
ENV ENV="/fly/set-stolon-environment.sh"
59+
ENV ENV="/fly/shell-init"
6060

6161
EXPOSE 5432
6262

scripts/set-stolon-environment.sh

-5
This file was deleted.

scripts/shell-init

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/dash
2+
# Dash sources this file according to POSIX envvar $ENV declared in Dockerfile
3+
# https://manpages.debian.org/stretch/dash/dash.1.en.html#Invocation
4+
5+
if [ -f /data/.env ]; then
6+
export $(cat /data/.env)
7+
fi
8+
9+
# Upgrade to Bash shell
10+
unset ENV
11+
exec /bin/bash "$@"

0 commit comments

Comments
 (0)