Repository navigation
fix: passes arguments to mysqld process in docker-entypoint.sh file, fixes #6668 - #6669
stijnveeke wants to merge 5 commits into
Conversation
|
This doesn't actually do anything until a matching image is built and pushed, and versionconstraints.go updated to use the new image. Moving to draft as a result. |
|
I'm inclined to not do this one, because it introduces new risks with no particular benefit to any but one known user, who has a clear workaround. Requested @stasadev 's opinion. |
stasadev
left a comment
There was a problem hiding this comment.
I see that "$@" can be passed in the official mariadb, mysql, mysql/bitnami:
- https://github.com/MariaDB/mariadb-docker/blob/master/10.11/docker-entrypoint.sh
- https://github.com/docker-library/mysql/blob/master/8.0/docker-entrypoint.sh
- https://github.com/bitnami/containers/blob/main/bitnami/mysql/9.0/debian-12/rootfs/opt/bitnami/scripts/mysql/entrypoint.sh
DDEV already does a pretty good job with customization, and it could be easier with the proposed change, I have no objections to adding this functionality.
… to apply in mysqld. Currently, passing an argument to the database container using commands inside the docker-compose file does not apply the arguments to the MySQL execution. This file change resolves the issue, allowing for a more flexible container configuration.
|
I pushed the db images and rebased. This feature needs manual testing and automated test coverage still. |
|
Download the artifacts for this pull request:
See Testing a PR. |
|
This causes unexpected failures and unpredicted results starting in TestExtraPackages. I had to use tmate to do a ddev logs -s db outputYou'll note that it's crazily picking up postgres config files: The reason for this is that .ddev/.ddev-docker-compose-full.yaml has this erroneous command in the db section: services:
db:
build:
args:
BASE_IMAGE: ddev/ddev-dbserver-mariadb-10.11:20241109_stijnveeke_mysql_args
gid: "127"
uid: "1001"
username: runner
context: /home/runner/tmp/ddevtest/TestPkgDrupal10781603732/.ddev/.dbimageBuild
dockerfile: Dockerfile
cap_add:
- SYS_NICE
command:
- -c
- config_file=/etc/postgresql/postgresql.conf
- -c
- hba_file=/etc/postgresql/pg_hba.confSomehow $DDEV_DB_CONTAINER_COMMAND has been left set in the environment; previously it was intended only for postgresql, but now with this change it's being picked up. This can be recreated with So it's TestPostgresConfigOverride that leaves the system in an inappropriate state. |
|
TestConfigDefaultContainerTimeout fails with too many arguments, |
|
Mostly we use args here in an environment for doing the snapshot function, which has been robust for a long time. I don't like the environment variable technique, and it could use a makeover. But the overall impact and destabilization of this proposed feature is not to my liking. It's more work than I'm willing to invest right now. |
|
Closing for now. If anybody wants to chase all the fallout, we can reopen it. Refactor to do something fancier than using that DDEV_DB_CONTAINER_COMMAND environment variable would be welcome also. |
The Issue
How This PR Solves The Issue
Checks for arguments if present and passes them to the mysqld execution. In case not present it will use the default execution process which is
mysqld --server-id=0.TODO
docker-compose.*.yamlManual Testing Instructions
Extend the functionality of the db container by adding to a docker compose additional execution arguments like this.
command: --server-id=1 --log-bin=mysql-bin --binlog-format=rowIt should now check if a server-id is present in case it is it will add the above arguments to the execution of mysqld in case this is not present it will append these arguments to the already present --server-id=0 argument.Automated Testing Overview
No automatic tests are needed because it always defaults back to the default functionality which is:
mysqld --server-id=0Release/Deployment Notes
Nothing has to change during deployment.