Skip to content

Commit

Permalink
Add test entry point to see container lifecycle in stage
Browse files Browse the repository at this point in the history
  • Loading branch information
danielle-tfh committed Jan 10, 2025
1 parent 7d6de6f commit d201bef
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,10 @@ COPY --from=build-app /src/gpu-iris-mpc/target/x86_64-unknown-linux-gnu/release/
COPY --from=build-app /src/gpu-iris-mpc/target/x86_64-unknown-linux-gnu/release/reshare-server /bin/reshare-server
COPY --from=build-app /src/gpu-iris-mpc/target/x86_64-unknown-linux-gnu/release/reshare-client /bin/reshare-client


# Copy your wrapper entrypoint script into the final container
COPY entrypoint.sh /test_entrypoint.sh
RUN chmod +x /test_entrypoint.sh

USER 65534
ENTRYPOINT ["/bin/server"]
ENTRYPOINT ["/test_entrypoint.sh", "/bin/server"]
16 changes: 16 additions & 0 deletions test_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -euo pipefail

# Function that prints the date on exit
on_exit() {
echo "[Container End] $(date) :: Container is stopping..."
}

# Register the function above to run when the script exits
trap on_exit EXIT

# Print a timestamp when container starts
echo "[Container Start] $(date) :: Container is starting..."

# Execute the main process
exec "$@"

0 comments on commit d201bef

Please sign in to comment.