From 0168f71f81a631989b3f0d60ef79264bcd2f45c0 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Sun, 27 Sep 2020 18:56:58 +0200 Subject: [PATCH] Conditional MySQL Client installation (#11174) This is the second step of making the Production Docker Image more corporate-environment friendly, by making MySQL client installation optional. Instaling MySQL Client on Debian requires to reach out to oracle deb repositories which might not be approved by security teams when you build the images. Also not everyone needs MySQL client or might want to install their own MySQL client or MariaDB client - from their own repositories. This change makes the installation step separated out to script (with prod/dev installation option). The prod/dev separation is needed because MySQL needs to be installed with dev libraries in the "Build" segment of the image (requiring build essentials etc.) but in "Final" segment of the image only runtime libraries are needed. Part of #11171 Depends on #11173. (cherry picked from commit 044b44125744fc49808db12ab72eed5147aed474) --- BREEZE.rst | 12 ++++++++++++ breeze | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/BREEZE.rst b/BREEZE.rst index 5b23c84f1f4d83..0d9c463d7ef406 100644 --- a/BREEZE.rst +++ b/BREEZE.rst @@ -1256,6 +1256,10 @@ This is the current syntax for `./breeze <./breeze>`_: Build options: + --disable-mysql-client-installation + Disables installation of the mysql client which might be problematic if you are building + image in controlled environment. Only valid for production image. + --disable-mysql-client-installation Disables installation of the mysql client which might be problematic if you are building image in controlled environment. Only valid for production image. @@ -1744,6 +1748,10 @@ This is the current syntax for `./breeze <./breeze>`_: Build options: + --disable-mysql-client-installation + Disables installation of the mysql client which might be problematic if you are building + image in controlled environment. Only valid for production image. + --disable-mysql-client-installation Disables installation of the mysql client which might be problematic if you are building image in controlled environment. Only valid for production image. @@ -2095,6 +2103,10 @@ This is the current syntax for `./breeze <./breeze>`_: Build options: + --disable-mysql-client-installation + Disables installation of the mysql client which might be problematic if you are building + image in controlled environment. Only valid for production image. + --disable-mysql-client-installation Disables installation of the mysql client which might be problematic if you are building image in controlled environment. Only valid for production image. diff --git a/breeze b/breeze index 63471d0d71d45c..15fee55a5d044c 100755 --- a/breeze +++ b/breeze @@ -1010,6 +1010,11 @@ function breeze::parse_arguments() { echo "Tag to add to the image: ${IMAGE_TAG}" shift 2 ;; + --disable-mysql-client-installation) + export INSTALL_MYSQL_CLIENT="false" + echo "Install MySQL client: ${INSTALL_MYSQL_CLIENT}" + shift + ;; -D | --dockerhub-user) export DOCKERHUB_USER="${2}" echo "Dockerhub user ${DOCKERHUB_USER}" @@ -2220,6 +2225,10 @@ ${FORMATTED_DEFAULT_PROD_EXTRAS} Build options: +--disable-mysql-client-installation + Disables installation of the mysql client which might be problematic if you are building + image in controlled environment. Only valid for production image. + --disable-mysql-client-installation Disables installation of the mysql client which might be problematic if you are building image in controlled environment. Only valid for production image.