Skip to content

Instantly share code, notes, and snippets.

@jonpugh
Created June 1, 2026 14:42
Show Gist options
  • Select an option

  • Save jonpugh/08151404e97e3e2f4d00269c3b6434c2 to your computer and use it in GitHub Desktop.

Select an option

Save jonpugh/08151404e97e3e2f4d00269c3b6434c2 to your computer and use it in GitHub Desktop.
Dockerfile Entrypoint script that runs BOOT_COMMAND before whatever the docker command is.
#!/bin/bash
set -e
echo "Hello from docker-entrypoint-boot-command!"
if [[ -n "${BOOT_COMMAND}" ]]; then
echo "> Running BOOT_COMMAND:"
echo $BOOT_COMMAND
echo
echo ============================
${BOOT_COMMAND}
echo ============================
echo "> Ended BOOT_COMMAND"
fi
echo "> Running command:"
echo "$@"
echo
echo ============================
exec "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment