-
Notifications
You must be signed in to change notification settings - Fork 443
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
docker compose watch; entrypoint loads bootstrap sql only once #625
Comments
I don't know what you mean by "standard build and run option works ok". The entrypoint is only meant to bootstrap the So as far as I"m concerned its working as expected. What functionality are you after and for what purpose? Something like #515? |
Thanks for reply.
I need a hint, I am wrong somewhere.
I use docker compose with watch mode - when bootstrap.sql file is changed,
image is rebuilt.
It is not a migrations problem.
First run is ok
```sh
docker compose up --watch --build
```
But any next change of `bootstrap.sql`, starting with second, - I've
checked - invokes creation of container with new bootstrap script - but - I
am really do not understand - entrypoint do not apply the bootstrap script.
But entrypoint must to do, because I am not using volums for now.
…On Mon, Dec 16, 2024, 08:58 Daniel Black ***@***.***> wrote:
I don't know what you mean by "standard build and run option works ok".
The entrypoint is only meant to bootstrap the /docker-entrypoint-initdb.d
during the initialization of the database.
So as far as I"m concerned its working as expected.
What functionality are you after and for what purpose? Something like #515
<#515>?
—
Reply to this email directly, view it on GitHub
<#625 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BLX2UAO23CEYSMSZUBG2RG32FZTXRAVCNFSM6AAAAABTUVLFA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBUGY3DSNBTGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
If the contents of the bootstrap file are idpotent perhaps using a configuration command: --init_file=/docker-entrypoint-initdb.d/bootstrap.sql. |
Yes, it is idempotent
And thanks for suggestion
But, please, help me to understand
How stateless operation of volumeless container creation can fail?
New image, new container, where problem can be started?
…On Mon, Dec 16, 2024, 09:27 Daniel Black ***@***.***> wrote:
If the contents of the bootstrap file are idpotent perhaps using a
configuration command:
--init_file=/docker-entrypoint-initdb.d/bootstrap.sql
<https://mariadb.com/kb/en/server-system-variables/#init_file>.
—
Reply to this email directly, view it on GitHub
<#625 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BLX2UAID5FQIFKALN2SEYQT2FZXGTAVCNFSM6AAAAABTUVLFA2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBUG4YTCMZRHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
If its truly without persistent volumes, and those were empty upon the next initialization, then your bootstrap.sql would be always running. I what you have is a stateful operation, even if not intended. Compose makes volumes persist. There a option to purge them, but by default down/up doesn't clear them. You aren't providing enough information for me to clearly follow what you are achieving/wanting to see/are actually seeing. More time preparing compose example with markdown formatted logs. Take your time, end of my working day, so if there's a single coherent thought/question/request here for my tomorrow I can answer this. If its vague I won't. |
@grooverdan Please, look at ready demo. |
Compose creates are volume:
After modifying bootstrap.sql, I observed the docker-compose rebuild, but the container, still the same volume:
On the restart:
It can only detect the "upgrade not required" if the datadirectory is there. Per previous - Using init-file as previously described will trigger idpotent changes, however the volume is still there:
|
@grooverdan you are right. But, why volume - i.e. image - not updated by docker compose, when I specify New file, new image, new volume - where I am wrong? Maybe, Dockerfile If I am right, how to omit the problem? |
Its actually the first I've come across https://docs.docker.com/compose/how-tos/file-watch/#action docs define the exact behaviour. |
Latest docker/compose, latest mariadb image.
Standard build and run option works ok, but in docker compose watch mode image entrypoint executes query in
/docker-entrypoint-initdb.d/bootstrap.sql
only at first docker compose up run.Can someone help or suggest?
The text was updated successfully, but these errors were encountered: