fix(docker): no foreground task in docker
This commit is contained in:
parent
d909765afc
commit
454cd8aae8
@ -10,5 +10,8 @@ ENV PATH=$FLINK_HOME/bin:$PATH
|
|||||||
# Expose necessary ports for the Flink UI (JobManager) and job manager
|
# Expose necessary ports for the Flink UI (JobManager) and job manager
|
||||||
EXPOSE 8081 6123
|
EXPOSE 8081 6123
|
||||||
|
|
||||||
|
COPY ./start-cluster.sh /opt/flink/bin/start-cluster.sh
|
||||||
|
RUN chmod +x /opt/flink/bin/start-cluster.sh
|
||||||
|
|
||||||
# Command to start Flink JobManager and TaskManager in a mini-cluster setup
|
# Command to start Flink JobManager and TaskManager in a mini-cluster setup
|
||||||
CMD ["bin/start-cluster.sh"]
|
CMD ["bin/start-cluster.sh"]
|
||||||
16
start-cluster.sh
Normal file
16
start-cluster.sh
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Alternatively, start TaskManager in the foreground if necessary
|
||||||
|
$FLINK_HOME/bin/taskmanager.sh start
|
||||||
|
|
||||||
|
# Start JobManager in the foreground
|
||||||
|
$FLINK_HOME/bin/jobmanager.sh start-foreground
|
||||||
|
|
||||||
|
# If you want to submit a job and still keep the cluster alive, use this:
|
||||||
|
if [[ -n "$FLINK_JOB" ]]; then
|
||||||
|
echo "Running Flink job: $FLINK_JOB"
|
||||||
|
$FLINK_HOME/bin/flink run -d $FLINK_JOB
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Keep the container running
|
||||||
|
tail -f /dev/null # This will prevent the container from exiting
|
||||||
Loading…
x
Reference in New Issue
Block a user