Skip to content

Commit

Permalink
using mode to control entrypoint script
Browse files Browse the repository at this point in the history
  • Loading branch information
Tianhao-Gu committed May 23, 2024
1 parent 9de9dd0 commit 23c934a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ RUN chmod a+x /opt/scripts/*.sh

# Switch back to the original user
USER ${ORI_USER}

ENTRYPOINT ["/opt/scripts/entrypoint.sh"]
CMD ["/opt/bitnami/scripts/spark/run.sh"]
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ services:
build:
context: .
dockerfile: Dockerfile
entrypoint: /opt/scripts/notebook_entrypoint.sh
container_name: spark-notebook
ports:
- "4041:4041"
Expand All @@ -109,5 +108,6 @@ services:
- MINIO_URL=http://minio:9000
- MINIO_ACCESS_KEY=minio
- MINIO_SECRET_KEY=minio123
- SPARK_MODE=notebook
volumes:
- ./cdr/cdm/jupyter:/cdm_shared_workspace
7 changes: 7 additions & 0 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

if [ "$SPARK_MODE" = "notebook" ]; then
exec /opt/scripts/notebook_entrypoint.sh "$@"
else
exec /opt/bitnami/scripts/spark/entrypoint.sh "$@"
fi

0 comments on commit 23c934a

Please sign in to comment.