Skip to content

Commit

Permalink
Exec Bash just after sourcing stolon env
Browse files Browse the repository at this point in the history
  • Loading branch information
dangra committed Oct 3, 2022
1 parent aa228da commit 9ef05f8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ RUN useradd -ms /bin/bash stolon
RUN mkdir -p /run/haproxy/
COPY --from=flyutil /fly/bin/* /usr/local/bin/

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

EXPOSE 5432

Expand Down
5 changes: 0 additions & 5 deletions scripts/set-stolon-environment.sh

This file was deleted.

11 changes: 11 additions & 0 deletions scripts/shell-init
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/dash
# Dash sources this file according to POSIX envvar $ENV declared in Dockerfile
# https://manpages.debian.org/stretch/dash/dash.1.en.html#Invocation

if [ -f /data/.env ]; then
export $(cat /data/.env)
fi

# Upgrade to Bash shell
unset ENV
exec /bin/bash "$@"

0 comments on commit 9ef05f8

Please sign in to comment.