Skip to content

Install dbconfig-no-thanks package#2059

Merged
georglauterbach merged 1 commit intodocker-mailserver:masterfrom
20th:master
Jun 27, 2021
Merged

Install dbconfig-no-thanks package#2059
georglauterbach merged 1 commit intodocker-mailserver:masterfrom
20th:master

Conversation

@20th
Copy link
Copy Markdown
Contributor

@20th 20th commented Jun 26, 2021

Description

The opendmarc package in Debian Buster includes an SQL schema to automatically create a MySQL database on installation. To do this, it has a dependency on dbconfig-mysql package which is installed during the build. However, since docker-mailserver does not actually have a MySQL server running, this results in the following errors during the build process:

Setting up opendmarc (1.3.2-6+deb10u2) ...
dbconfig-common: writing config to /etc/dbconfig-common/opendmarc.conf

Creating config file /etc/dbconfig-common/opendmarc.conf with new version
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2).
unable to connect to mysql server.
error encountered creating user:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
dbconfig-common: opendmarc configure: noninteractive fail.
dbconfig-common: opendmarc configure: ignoring errors from here forwards
populating database via sql...  done.
dbconfig-common: flushing administrative password
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.

It is not critical because the errors are ignored, but they can be fixed completely by explicitly installing the alternative dbconfig-no-thanks package.

As far as I can tell, opendmarc is not configured to use the database in anyway, so this change does not remove any functionality. But this way, since dbconfig-mysql does not pull its dependencies (mariadb-client-10.3, mariadb-client-core-10.3, mariadb-common, mysql-common), the resulting image is a little bit smaller:

623MB with dbconfig-mysql
571MB with dbconfig-no-thanks

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (non-breaking change that does improve existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (README.md or the documentation under docs/)
  • If necessary I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Debian opendmarc package has a dependency on dbconfig-mysql, which it
will pull, together with its dependencies, during image build.

Explicitly listing an alternative dbconfig-no-thanks package prevents
installation of unnecessary packages and reduces the image size.
@georglauterbach
Copy link
Copy Markdown
Member

georglauterbach commented Jun 27, 2021

50MB Image size reduction? Nice!

Thank you for submitting this PR, very welcome!

@georglauterbach georglauterbach requested review from a team and georglauterbach June 27, 2021 08:37
@georglauterbach georglauterbach added area/dependency kind/improvement Improve an existing feature, configuration file or the documentation priority/medium labels Jun 27, 2021
@georglauterbach georglauterbach added this to the v10.0.1 milestone Jun 27, 2021
@georglauterbach georglauterbach requested a review from a team June 27, 2021 08:40
@georglauterbach georglauterbach merged commit 772016e into docker-mailserver:master Jun 27, 2021
@wernerfred
Copy link
Copy Markdown
Member

Thanks for your contribution!

@casperklein casperklein modified the milestones: v10.0.1, v10.1.0 Jun 30, 2021
@wernerfred wernerfred modified the milestones: v10.1.0, v10.0.1 Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/improvement Improve an existing feature, configuration file or the documentation priority/medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants