You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[bitnami/kafka] - docker env variable for topic creation
What is the problem this feature will solve?
Name and Version
bitnami/kafka
I am dealing with a project in which I need my containers to run only after the Kafka container is up and has a topic running in it.
I cannot create a topic using RUN, CMD or ENTRYPOINT commands in Docker.
What is the feature you are proposing to solve the problem?
The feature would be a docker variable to start a topic automatically and the posisbility of checking whether it's running with a health check.
What alternatives have you considered?
Currently I have another container init_kafka in which I ping to the original kafka container and then I create a topic in it.
Then, my topic dependent containers have a depends_only condition that depend on the init_kafka
### Examples in other docker images
A good example of such a feature that was implemented elsewhere is in wurstmeister image. They have a variable called "KAFKA_CREATE_TOPICS". Something along those lines would work just fine.
The text was updated successfully, but these errors were encountered:
The kafka container has an option to run custom init scripts mounted at /docker-entrypoint-initdb.d
kafka_custom_init_scripts() {
if [[ -n $(find "${KAFKA_INITSCRIPTS_DIR}/" -type f -regex ".*\.\(sh\)") ]] && [[ ! -f "${KAFKA_VOLUME_DIR}/.user_scripts_initialized" ]]; then
info "Loading user's custom files from $KAFKA_INITSCRIPTS_DIR"
for f in /docker-entrypoint-initdb.d/*; do
debug "Executing $f"
case "$f" in
*.sh)
if [[ -x "$f" ]]; then
if ! "$f"; then
error "Failed executing $f"
return 1
fi
else
warn "Sourcing $f as it is not executable by the current user, any error may cause initialization to fail"
. "$f"
fi
;;
*)
warn "Skipping $f, supported formats are: .sh"
;;
esac
done
touch "$KAFKA_VOLUME_DIR"/.user_scripts_initialized
fi
}
You could try mounting a script that creates a topic. Would that work for your use case?
Name and Version
[bitnami/kafka] - docker env variable for topic creation
What is the problem this feature will solve?
Name and Version
bitnami/kafka
I am dealing with a project in which I need my containers to run only after the Kafka container is up and has a topic running in it.
I cannot create a topic using RUN, CMD or ENTRYPOINT commands in Docker.
What is the feature you are proposing to solve the problem?
The feature would be a docker variable to start a topic automatically and the posisbility of checking whether it's running with a health check.
What alternatives have you considered?
Currently I have another container init_kafka in which I ping to the original kafka container and then I create a topic in it.
Then, my topic dependent containers have a depends_only condition that depend on the init_kafka
### Examples in other docker images
A good example of such a feature that was implemented elsewhere is in wurstmeister image. They have a variable called "KAFKA_CREATE_TOPICS". Something along those lines would work just fine.
The text was updated successfully, but these errors were encountered: