Skip to content

"Init only" flag for startup #192

Closed
Closed
@danquah

Description

@danquah

Question as much as a feature-request:

Would you accept a PR that introduced a flag for docker-entrypoint.sh that would cause it to only do and initialisation and then quit?

We currently run a forked version of this image that does this by having last exec "$@" line (https://github.com/docker-library/mariadb/blob/befa40c64b4a51b012fb432a3cf9e08e88f9b263/10.3/docker-entrypoint.sh#L190) removed. We use the image for importing a nightly database-dump into mariadb, and then export /var/lib/mysql into a data-only image which our developers then can mount when doing support work. The script that does this simply starts up the image with a /var/lib/mysql volume mounted, waits for it to exit successfully, and then starts up another image with the same volume mounted that does the export.

This method gives us a very short startup time as compared to doing a full sql-import, and it really helps for larger database dumps.

Apart from our use case I guess the same solution could be used for a simple test of the integrity of a dump. Set the flag, start up the container, and if it exists successfully it was able to do the import without any issues.

As mentioned our current solution is a fork with a very crude fix, but I'll be happy to implement a more clean configurable solution with eg. an environment variable for switching on the behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RequestRequest for image modification or featurequestionUsability question, not directly related to an error with the image

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions