diff --git a/percona-server-8.0/Dockerfile b/percona-server-8.0/Dockerfile index 2fb7576c..fc1002de 100644 --- a/percona-server-8.0/Dockerfile +++ b/percona-server-8.0/Dockerfile @@ -23,6 +23,9 @@ ENV FULL_PERCONA_VERSION "$PS_VERSION.$OS_VER" ENV FULL_MYSQL_SHELL_VERSION "$MYSQL_SHELL_VERSION.$OS_VER" ENV PS_REPO release +# Do not report during Docker image creation. +ARG PERCONA_TELEMETRY_DISABLE=1 + # check repository package signature in secure way RUN set -ex; \ export GNUPGHOME="$(mktemp -d)"; \ @@ -81,6 +84,10 @@ RUN set -ex; \ VOLUME ["/var/lib/mysql", "/var/log/mysql"] +COPY call-home.sh /call-home.sh +RUN mkdir -p /usr/local/percona +RUN chown mysql:mysql /usr/local/percona + COPY ps-entry.sh /docker-entrypoint.sh ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/percona-server-8.0/ps-entry.sh b/percona-server-8.0/ps-entry.sh index e356917d..81433d10 100755 --- a/percona-server-8.0/ps-entry.sh +++ b/percona-server-8.0/ps-entry.sh @@ -227,4 +227,23 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then fi fi + +CALL_HOME_OPTIONAL_PARAMS= + +if [ ! -z "$PERCONA_INSTANCE_ID" ]; then + CALL_HOME_OPTIONAL_PARAMS+=" -i ${PERCONA_INSTANCE_ID}" +fi + +if [ ! -z "$PERCONA_TELEMETRY_CONFIG_FILE_PATH" ]; then + CALL_HOME_OPTIONAL_PARAMS+=" -j ${PERCONA_TELEMETRY_CONFIG_FILE_PATH}" +fi + +if [ ! -z "$PERCONA_SEND_TIMEOUT" ]; then + CALL_HOME_OPTIONAL_PARAMS+=" -j ${PERCONA_SEND_TIMEOUT}" +fi + +# PERCONA_TELEMETRY_DISABLE is handled at the very beginning of call-home.sh +/call-home.sh -f "PRODUCT_FAMILY_PS" -v "$PS_VERSION" -s "$OS_VER" -d "DOCKER" ${CALL_HOME_OPTIONAL_PARAMS} + + exec "$@"