Skip to content

Trying to override docker-entrypoint.sh sourcing original one fails #452

Closed
@typoworx-de

Description

@typoworx-de

I'm trying to override docker-entrypoint.sh to implement a feature being able to import sql-patches (not initdb).

my script looks like this and I'm overriding entrypoint in my docker-compose.yml

docker-compose.overrides.yml

version: '3.6'

services:
  db:
    entrypoint: bash /root/bin/custom-entrypoint.sh
  volumes:
    - ./docker/db/bin/:/root/bin

/root/bin/custom-entrypoint.sh (inside container)

#!/bin/bash

echo "Running entrypoint $0"

source /docker-entrypoint.sh
_main "$@"

# custom stuff goes here

Restarting the stack results in the following error in the new entrypoint:

_main command not found

It looks like the source'ing is somehow ignored for my own entrypoint script.

Is there any draft how to properly do this? I think the last line in the original-entrypoint in this project already proposes a draft on how to use it, but for some reason the functions of this script are not sourced/imported in the custom entrypoint :-/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions