-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dockerfile: split out cleaning image
Also; significant change in approach to removing unnecessary contents; we now keep a whitelist instead of a blacklist. Initial savings look promising: ```console REPOSITORY TAG IMAGE ID CREATED SIZE jbergstroem/mariadb-alpine latest b8ebaf0bb7ac 10 minutes ago 38.5MB jbergstroem/mariadb-alpine f7e985e 7f924e8b227c 9 hours ago 42.2MB ```
- Loading branch information
1 parent
4dd5a35
commit f59b91a
Showing
3 changed files
with
36 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
* | ||
!run.sh | ||
!clean.sh | ||
!my.cnf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
set -euo pipefail | ||
|
||
TO_KEEP=$(echo " | ||
usr/bin/mysql$ | ||
usr/bin/mysqld$ | ||
usr/bin/mariadb$ | ||
usr/bin/getconf$ | ||
usr/bin/getent$ | ||
usr/bin/resolveip$ | ||
usr/bin/my_print_defaults$ | ||
usr/bin/mysql_install_db$ | ||
usr/share/mariadb/charsets | ||
usr/share/mariadb/english | ||
usr/share/mariadb/mysql_system_tables.sql$ | ||
usr/share/mariadb/mysql_performance_tables.sql$ | ||
usr/share/mariadb/mysql_system_tables_data.sql$ | ||
usr/share/mariadb/maria_add_gis_sp_bootstrap.sql$ | ||
usr/share/mariadb/fill_help_tables.sql$" | | ||
tr -d " \t\n\r" | sed -e 's/usr/|usr/g' -e 's/^.//') | ||
|
||
INSTALLED_FILES="$(apk info -q -L mariadb-client | tail -n +2) | ||
$(apk info -q -L mariadb-common | tail -n +2) | ||
$(apk info -q -L mariadb | tail -n +2)" | ||
|
||
for path in $(echo "${INSTALLED_FILES}" | grep -v -E "${TO_KEEP}"); do | ||
eval rm -rf "${path}" | ||
done |