Skip to content

Commit

Permalink
Merge pull request #82 from fly-apps/exec-into-bash
Browse files Browse the repository at this point in the history
Exec Bash just after sourcing stolon env
  • Loading branch information
dangra authored Oct 3, 2022
2 parents aa228da + 9ef05f8 commit 9864b5f
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 9864b5f

Please sign in to comment.