-
Notifications
You must be signed in to change notification settings - Fork 763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for running initialization scripts #60
Conversation
@shanegenschaw - Thanks for submitting this PR. Our plan is to add this functionality to a hopefully near future release of SQL Server. The current thinking is that we would have the sqlservr process execute these SQL scripts on startup as opposed to a .sh with sqlcmd. That way we can have a universal solution for SQL on Linux and on Windows. The sqlservr process could look for an env variable which contained either a directory path to a set of files or a json formatted list of full paths to files. What do you think about that approach? |
@twright-msft - your approach sounds fantastic. Good idea to have a universal & consistent solution across platforms. Thanks for your consideration! |
OK cool. We'll get 'er done then. We'll close out this PR since it will be implemented in a different but conceptually similar way. Thanks for contributing and keep the suggestions/PRs coming! |
@twright-msft Was this ever done? Not able to find any docs about it. For now I'm trying to run an Dockerfile
entrypoint.sh
|
Take a look at this example: |
Any luck on having a better solution? |
Any chance this can be in 2022? 😊 |
Something to look at... |
Thank you but I am looking for official Microsoft support |
2023 and nothing. The official demo https://github.com/mcmoe/mssqldocker is a fat container, which is not a good idea. Mysql, MariaDb, Postgress, even Oracle has the classic
@shanegenschaw your approach was good. No body uses windows for docker :( |
+1, it's been six years, let's be realistic and not let the perfect be the enemy of the good. Can this please get re-opened and merged? |
Applies to mssql-server-linux, issue #11, adding functionality to mount initialization scripts and execute them when the container is started.
When a container is started for the first time, it will execute any files with extensions .sh or .sql that are found in /docker-entrypoint-initdb.d. Files will be executed in alphabetical order. You can easily populate your SQL Server services by mounting scripts into that directory and provide custom images with contributed data.