Skip to content
Snippets Groups Projects
Select Git revision
  • e36b4f57b77618787caae825a72b93f8f40a8f74
  • master default protected
  • dwmcallister-patch-1
  • 520-fix-wsl
  • tune-worker-processes
  • alpine-nginxorg
  • 1.29.1
  • 1.29.0
  • 1.28.0
  • 1.27.5
  • 1.27.3
  • 1.27.2
  • 1.27.0
  • 1.26.1
  • 1.26.0
  • 1.25.5
  • 1.25.4
  • 1.25.3
  • 1.25.2
  • 1.25.1
  • 1.25.0
  • 1.24.0
  • 1.23.3
  • 1.23.4
  • 1.23.2
  • 1.22.1
26 results

docker-entrypoint.sh

Blame
  • user avatar
    Konstantin Pavlov authored
    This allows to launch configuration scripts on the start of container.
    e36b4f57
    History
    docker-entrypoint.sh 1.09 KiB
    #!/usr/bin/env sh
    # vim:sw=4:ts=4:et
    
    set -e
    
    if [ "$1" = "nginx" ]; then
        if /usr/bin/find "/docker-entrypoint.d/" -mindepth 1 -print -quit 2>/dev/null | /bin/grep -q .; then
            echo "$0: /docker-entrypoint.d/ is not empty, will attempt to perform an initial configuration"
    
            echo "$0: Looking for shell scripts in /docker-entrypoint.d/"
            for f in $(/usr/bin/find /docker-entrypoint.d/ -type f -name "*.sh" -executable | sort -n); do
                echo "$0: Launching $f";
                "$f"
            done
    
            # warn on shell scripts without exec bit
            for f in $(/usr/bin/find /docker-entrypoint.d/ -type f -name "*.sh" -not -executable); do
                echo "$0: Ignoring $f, not executable";
            done
            # warn on filetypes we don't know what to do with
            for f in $(/usr/bin/find /docker-entrypoint.d/ -type f -not -name "*.sh"); do
                echo "$0: Ignoring $f";
            done
    
            echo "$0: Initial configuration complete; ready for start up"
        else
            echo "$0: /docker-entrypoint.d/ is empty, skipping initial configuration"
        fi
    fi
    
    exec "$@"