diff --git a/simplerisk-minimal/common/entrypoint.sh b/simplerisk-minimal/common/entrypoint.sh index 2dcda61..83649c2 100644 --- a/simplerisk-minimal/common/entrypoint.sh +++ b/simplerisk-minimal/common/entrypoint.sh @@ -108,7 +108,7 @@ delete_db(){ print_log "db_deletion: prepare" "Performing database deletion" # Needed to separate the GRANT statement from the rest because it was providing a syntax error - exec_cmd "mysql --protocol=socket -u $DB_SETUP_USER -p$DB_SETUP_PASS -h$SIMPLERISK_DB_HOSTNAME -P$SIMPLERISK_DB_PORT < /etc/apt/sources.list.d/mysql.list - -# Installing apt dependencies -RUN apt-get update && \\ +# Creating keyring env and installing apt dependencies +RUN mkdir -p /etc/apt/keyrings && \\ + apt-get update && \\ + apt-get install -y gnupg2 wget && \\ + wget -qO - $MYSQL_KEY_URL | gpg --dearmor -o /etc/apt/keyrings/mysql.gpg && \\ + echo 'deb [signed-by=/etc/apt/keyrings/mysql.gpg] http://repo.mysql.com/apt/\$(lsb_release -si | tr '[:upper:]' '[:lower:]')/ \$(lsb_release -sc) mysql-8.0' | tee /etc/apt/sources.list.d/mysql.list && \\ + apt-key adv --keyserver pgp.mit.edu --recv-keys A8D3785C && \\ + echo "deb http://repo.mysql.com/apt/debian bookworm mysql-8.0" > /etc/apt/sources.list.d/mysql.list && \\ + apt-get update && \\ apt-get -y install libldap2-dev \\ libicu-dev \\ libcap2-bin \\ @@ -91,9 +94,10 @@ RUN echo 'upload_max_filesize = 5M' >> /usr/local/etc/php/conf.d/docker-php-uplo RUN rm -rf /var/www/html && \\ EOF -[ ! $release == "testing" ] && echo " curl -sL https://simplerisk-downloads.s3.amazonaws.com/public/bundles/simplerisk-$release.tgz | tar xz -C /var/www && \\" >> "$image_dir/Dockerfile" || true +# shellcheck disable=SC2015 +[ ! "$release" == "testing" ] && echo " curl -sL https://simplerisk-downloads.s3.amazonaws.com/public/bundles/simplerisk-$release.tgz | tar xz -C /var/www && \\" >> "$image_dir/Dockerfile" || true echo " echo $release > /tmp/version" >> "$image_dir/Dockerfile" -if [ $release == "testing" ]; then +if [ "$release" == "testing" ]; then cat << EOF >> "$image_dir/Dockerfile" COPY ./simplerisk/ /var/www/simplerisk COPY common/simplerisk.sql /var/www/simplerisk/simplerisk.sql diff --git a/simplerisk-minimal/php81/Dockerfile b/simplerisk-minimal/php81/Dockerfile index 69be088..da059ee 100644 --- a/simplerisk-minimal/php81/Dockerfile +++ b/simplerisk-minimal/php81/Dockerfile @@ -7,14 +7,15 @@ LABEL maintainer="Simplerisk " WORKDIR /var/www -# Add the apt config package -RUN apt-get update && \ - apt-get install -y gnupg2 && \ +# Creating keyring env and installing apt dependencies +RUN mkdir -p /etc/apt/keyrings && \ + apt-get update && \ + apt-get install -y gnupg2 wget && \ + wget -qO - http://repo.mysql.com/RPM-GPG-KEY-mysql-2023 | gpg --dearmor -o /etc/apt/keyrings/mysql.gpg && \ + echo 'deb [signed-by=/etc/apt/keyrings/mysql.gpg] http://repo.mysql.com/apt/$(lsb_release -si | tr '[:upper:]' '[:lower:]')/ $(lsb_release -sc) mysql-8.0' | tee /etc/apt/sources.list.d/mysql.list && \ apt-key adv --keyserver pgp.mit.edu --recv-keys A8D3785C && \ - echo "deb http://repo.mysql.com/apt/debian bookworm mysql-8.0" > /etc/apt/sources.list.d/mysql.list - -# Installing apt dependencies -RUN apt-get update && \ + echo "deb http://repo.mysql.com/apt/debian bookworm mysql-8.0" > /etc/apt/sources.list.d/mysql.list && \ + apt-get update && \ apt-get -y install libldap2-dev \ libicu-dev \ libcap2-bin \ diff --git a/simplerisk-minimal/php83/Dockerfile b/simplerisk-minimal/php83/Dockerfile index 7c81154..172ede5 100644 --- a/simplerisk-minimal/php83/Dockerfile +++ b/simplerisk-minimal/php83/Dockerfile @@ -7,14 +7,15 @@ LABEL maintainer="Simplerisk " WORKDIR /var/www -# Add the apt config package -RUN apt-get update && \ - apt-get install -y gnupg2 && \ +# Creating keyring env and installing apt dependencies +RUN mkdir -p /etc/apt/keyrings && \ + apt-get update && \ + apt-get install -y gnupg2 wget && \ + wget -qO - http://repo.mysql.com/RPM-GPG-KEY-mysql-2023 | gpg --dearmor -o /etc/apt/keyrings/mysql.gpg && \ + echo 'deb [signed-by=/etc/apt/keyrings/mysql.gpg] http://repo.mysql.com/apt/$(lsb_release -si | tr '[:upper:]' '[:lower:]')/ $(lsb_release -sc) mysql-8.0' | tee /etc/apt/sources.list.d/mysql.list && \ apt-key adv --keyserver pgp.mit.edu --recv-keys A8D3785C && \ - echo "deb http://repo.mysql.com/apt/debian bookworm mysql-8.0" > /etc/apt/sources.list.d/mysql.list - -# Installing apt dependencies -RUN apt-get update && \ + echo "deb http://repo.mysql.com/apt/debian bookworm mysql-8.0" > /etc/apt/sources.list.d/mysql.list && \ + apt-get update && \ apt-get -y install libldap2-dev \ libicu-dev \ libcap2-bin \