Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only call entrypoint once #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ ARG MAVEN_TAG=latest
FROM maven:${MAVEN_TAG}

ADD setup.sh /
ADD entrypoint.sh /
RUN /setup.sh && \
rm -f /setup.sh

ADD entrypoint.sh /
ADD init.sh /
ADD ./mvn /usr/local/bin/mvn

ENV DISPLAYNUM=99
Expand Down
5 changes: 2 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/sh

Xvfb :$DISPLAYNUM -screen $SCREENNUM 1920x1080x24 > /dev/null 2>&1 &
#!/bin/sh -eu

/init.sh
exec /usr/local/bin/mvn-entrypoint.sh "$@"
10 changes: 10 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh -eu

ENTRYPOINT_LOCK_FILE=/tmp/.mdsdtools_init_xvfb.lock

if [ ! -f "$ENTRYPOINT_LOCK_FILE" ]; then
# start virtual frame buffer
Xvfb :$DISPLAYNUM -screen $SCREENNUM 1920x1080x24 > /dev/null 2>&1 &
touch "$ENTRYPOINT_LOCK_FILE"
fi

6 changes: 3 additions & 3 deletions mvn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

exec /entrypoint.sh /usr/bin/mvn "$@"
#!/bin/sh -eu

/init.sh
exec /usr/bin/mvn "$@"