diff --git a/Dockerfile b/Dockerfile index 7ffc09b47..85a88cd97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -ARG BZDB="-mysql8" -FROM bugzilla/bugzilla-perl-slim${BZDB}:20240419.1 +ARG BZDB="-mysql" +FROM bugzilla/bugzilla-perl-slim${BZDB}:20250925.1 ENV DEBIAN_FRONTEND noninteractive diff --git a/Makefile.PL b/Makefile.PL index e5607385a..0a89d7fe2 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -90,6 +90,7 @@ my %requires = ( 'Role::Tiny' => '2.000003', 'Scope::Guard' => '0.21', 'Sereal' => '4.004', + 'Sub::Identify' => 0, 'Sub::Quote' => '2.005000', 'Template' => '3.008', 'Text::CSV_XS' => '1.26', @@ -199,7 +200,7 @@ my %optional_features = ( jsonrpc => { description => 'JSON-RPC Interface', prereqs => { - runtime => {requires => {'JSON::RPC' => '== 1.01', 'Test::Taint' => '1.06'}} + runtime => {requires => {'JSON::RPC' => '1.01', 'Test::Taint' => '1.06'}} } }, linux_pdeath => { @@ -283,7 +284,7 @@ my %optional_features = ( rest => { description => 'REST Interface', prereqs => { - runtime => {requires => {'Test::Taint' => '1.06', 'JSON::RPC' => '==1.01',}} + runtime => {requires => {'Test::Taint' => '1.06', 'JSON::RPC' => '1.01',}} } }, s3 => { diff --git a/cpanfile b/cpanfile index b4c3a0f10..2aec85055 100644 --- a/cpanfile +++ b/cpanfile @@ -68,6 +68,7 @@ requires 'Role::Tiny', '2.000003'; requires 'SOAP::Lite', '0.712'; requires 'Scope::Guard', '0.21'; requires 'Sereal', '4.004'; +requires 'Sub::Identify'; requires 'Sub::Quote', '2.005000'; requires 'Sys::Syslog'; requires 'Template', '3.008'; diff --git a/docker-compose.test-mariadb.yml b/docker-compose.test-mariadb.yml index 832a4594f..b1c190169 100644 --- a/docker-compose.test-mariadb.yml +++ b/docker-compose.test-mariadb.yml @@ -8,7 +8,7 @@ services: bugzilla6.test: build: args: - - BZDB=-mariadb106 + - BZDB=-mariadb context: . dockerfile: Dockerfile command: dev_httpd diff --git a/docker-compose.test-pg.yml b/docker-compose.test-pg.yml index 06479194d..bb7dafe38 100644 --- a/docker-compose.test-pg.yml +++ b/docker-compose.test-pg.yml @@ -8,7 +8,7 @@ services: bugzilla6.test: build: args: - - BZDB=-pg9 + - BZDB=-pg context: . dockerfile: Dockerfile command: dev_httpd @@ -18,7 +18,7 @@ services: environment: - 'BMO_inbound_proxies=*' - BMO_db_driver=pg - - BMO_db_host=bugzilla6.pgsql9 + - BMO_db_host=bugzilla6.pgsql13 - BMO_db_name=bugs - BMO_db_pass=bugs - BMO_db_user=bugs @@ -40,12 +40,12 @@ services: - TWD_HOST=selenium - TWD_PORT=4444 depends_on: - - bugzilla6.pgsql9 + - bugzilla6.pgsql13 - memcached - selenium - bugzilla6.pgsql9: - image: postgres:9.0 + bugzilla6.pgsql13: + image: postgres:13.22 tmpfs: - /tmp logging: diff --git a/docker-compose.test.yml b/docker-compose.test.yml index f4f574066..b2f5d4efc 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -43,9 +43,9 @@ services: - selenium bugzilla6.mysql8: - build: - context: . - dockerfile: docker/images/Dockerfile.mysql8 + image: mysql:8 + command: + - '--max_allowed_packet=64M' tmpfs: - /tmp logging: diff --git a/docker-compose.yml b/docker-compose.yml index 299f951bd..33cf6f391 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -95,9 +95,9 @@ services: # - memcached bugzilla6.mysql8: - build: - context: . - dockerfile: docker/images/Dockerfile.mysql8 + image: mysql:8 + command: + - '--max_allowed_packet=64M' volumes: - bugzilla6-mysql-db:/var/lib/mysql tmpfs: diff --git a/docker/gen-bugzilla-perl-slim.sh b/docker/gen-bugzilla-perl-slim.sh deleted file mode 100644 index 95a4ca165..000000000 --- a/docker/gen-bugzilla-perl-slim.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/bash -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This Source Code Form is "Incompatible With Secondary Licenses", as -# defined by the Mozilla Public License, v. 2.0. - -if [ ! -e 'Makefile.PL' ]; then - echo - echo "Please run this from the root of the Bugzilla source tree." - echo - exit -1 -fi -if [ -z "$DOCKER" ]; then - DOCKER=`which docker` -fi -if [ ! -x "$DOCKER" ]; then - echo - echo "You specified a custom Docker executable via the DOCKER" - echo "environment variable at $DOCKER" - echo "which either does not exist or is not executable." - echo "Please fix it to point at a working Docker or remove the" - echo "DOCKER environment variable to use the one in your PATH" - echo "if it exists." - echo - exit -1 -fi -if [ -z "$DOCKER" ]; then - echo - echo "You do not appear to have docker installed or I can't find it." - echo "Windows and Mac versions can be downloaded from" - echo "https://www.docker.com/products/docker-desktop" - echo "Linux users can install using your package manager." - echo - echo "Please install docker or specify the location of the docker" - echo "executable in the DOCKER environment variable and try again." - echo - exit -1 -fi -$DOCKER info 1>/dev/null 2>/dev/null -if [ $? != 0 ]; then - echo - echo "The docker daemon is not running or I can't connect to it." - echo "Please make sure it's running and try again." - echo - exit -1 -fi -if [ ! -f "docker/images/Dockerfile.bugzilla-slim" ]; then - echo - echo "Can't locate the Dockerfile, try running from the root of" - echo "your Bugzilla checkout." - echo - exit -1 -fi - -export DOCKER_CLI_HINTS=false -export CI="" -export CIRCLE_SHA1="" -export CIRCLE_BUILD_URL="" -#$DOCKER build -t bugzilla-cpanfile -f Dockerfile.cpanfile . -#$DOCKER run -it -v "$(pwd):/app/result" bugzilla-cpanfile cp cpanfile cpanfile.snapshot /app/result - -# Figure out the tag name to use for the image. We'll do this by generating -# a code based on today's date, then attempt to pull it from DockerHub. If -# we successfully pull, then it already exists, and we bump the interation -# number on the end. -DATE=`date +"%Y%m%d"` -ITER=1 -$DOCKER pull bugzilla/bugzilla-perl-slim:${DATE}.${ITER} >/dev/null 2>/dev/null -while [ $? == 0 ]; do - # as long as we succesfully pull, keep bumping the number on the end - ((ITER++)) - $DOCKER pull bugzilla/bugzilla-perl-slim:${DATE}.${ITER} >/dev/null 2>/dev/null -done -$DOCKER build -t bugzilla/bugzilla-perl-slim:${DATE}.${ITER} -f docker/images/Dockerfile.bugzilla-slim . -if [ $? == 0 ]; then - echo - echo "The build appears to have succeeded. Don't forget to change the FROM line" - echo "at the top of Dockerfile to use:" - echo " bugzilla/bugzilla-perl-slim:${DATE}.${ITER}" - echo "to make use of this image." - echo - # check if the user is logged in - if [ -z "$PYTHON" ]; then - PYTHON=`which python` - fi - if [ -z "$PYTHON" ]; then - PYTHON=`which python3` - fi - if [ ! -x "$PYTHON" ]; then - echo "The python executable specified in your PYTHON environment value or your PATH is not executable or I can't find it." - exit -1 - fi - AUTHINFO=`$PYTHON -c "import json; print(len(json.load(open('${HOME}/.docker/config.json','r',encoding='utf-8'))['auths']))"` - if [ $AUTHINFO -gt 0 ]; then - # user is logged in - read -p "Do you wish to push to DockerHub? [y/N]: " yesno - case $yesno in - [Yy]*) - echo "Pushing..." - $DOCKER push bugzilla/bugzilla-perl-slim:${DATE}.${ITER} - ;; - *) - echo "Not pushing. You can just run this script again when you're ready" - echo "to push. The prior build result is cached." - ;; - esac - fi -else - echo - echo "Docker build failed. See output above." - echo - exit -1 -fi diff --git a/docker/gen-bugzilla-slim-mariadb106.sh b/docker/gen-bugzilla-slim-mariadb106.sh deleted file mode 100644 index 9cb56c277..000000000 --- a/docker/gen-bugzilla-slim-mariadb106.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This Source Code Form is "Incompatible With Secondary Licenses", as -# defined by the Mozilla Public License, v. 2.0. - -if [ ! -e 'Makefile.PL' ]; then - echo - echo "Please run this from the root of the Bugzilla source tree." - echo - exit -1 -fi -if [ -z "$DOCKER" ]; then - DOCKER=`which docker` -fi -if [ ! -x "$DOCKER" ]; then - echo - echo "You specified a custom Docker executable via the DOCKER" - echo "environment variable at $DOCKER" - echo "which either does not exist or is not executable." - echo "Please fix it to point at a working Docker or remove the" - echo "DOCKER environment variable to use the one in your PATH" - echo "if it exists." - echo - exit -1 -fi -if [ -z "$DOCKER" ]; then - echo - echo "You do not appear to have docker installed or I can't find it." - echo "Windows and Mac versions can be downloaded from" - echo "https://www.docker.com/products/docker-desktop" - echo "Linux users can install using your package manager." - echo - echo "Please install docker or specify the location of the docker" - echo "executable in the DOCKER environment variable and try again." - echo - exit -1 -fi -$DOCKER info 1>/dev/null 2>/dev/null -if [ $? != 0 ]; then - echo - echo "The docker daemon is not running or I can't connect to it." - echo "Please make sure it's running and try again." - echo - exit -1 -fi -if [ ! -f "docker/images/Dockerfile.bugzilla-mariadb106" ]; then - echo - echo "Can't locate the Dockerfile, try running from the root of" - echo "your Bugzilla checkout." - echo - exit -1 -fi - -export DOCKER_CLI_HINTS=false -export CI="" -export CIRCLE_SHA1="" -export CIRCLE_BUILD_URL="" - -# Figure out the tag name to use for the image. We'll do this by generating -# a code based on today's date, then attempt to pull it from DockerHub. If -# we successfully pull, then it already exists, and we bump the interation -# number on the end. -DATE=`date +"%Y%m%d"` -ITER=1 -$DOCKER pull bugzilla/bugzilla-perl-slim-mariadb106:${DATE}.${ITER} >/dev/null 2>/dev/null -while [ $? == 0 ]; do - # as long as we succesfully pull, keep bumping the number on the end - ((ITER++)) - $DOCKER pull bugzilla/bugzilla-perl-slim-mariadb106:${DATE}.${ITER} >/dev/null 2>/dev/null -done -$DOCKER build -t bugzilla/bugzilla-perl-slim-mariadb106:${DATE}.${ITER} -f docker/images/Dockerfile.bugzilla-mariadb106 . -if [ $? == 0 ]; then - echo - echo "The build appears to have succeeded. Don't forget to change the FROM line" - echo "at the top of Dockerfile to use:" - echo " bugzilla/bugzilla-perl-slim-mariadb106:${DATE}.${ITER}" - echo "to make use of this image." - echo - # check if the user is logged in - if [ -z "$PYTHON" ]; then - PYTHON=`which python` - fi - if [ -z "$PYTHON" ]; then - PYTHON=`which python3` - fi - if [ ! -x "$PYTHON" ]; then - echo "The python executable specified in your PYTHON environment value or your PATH is not executable or I can't find it." - exit -1 - fi - AUTHINFO=`$PYTHON -c "import json; print(len(json.load(open('${HOME}/.docker/config.json','r',encoding='utf-8'))['auths']))"` - if [ $AUTHINFO -gt 0 ]; then - # user is logged in - read -p "Do you wish to push to DockerHub? [y/N]: " yesno - case $yesno in - [Yy]*) - echo "Pushing..." - $DOCKER push bugzilla/bugzilla-perl-slim-mariadb106:${DATE}.${ITER} - ;; - *) - echo "Not pushing. You can just run this script again when you're ready" - echo "to push. The prior build result is cached." - ;; - esac - fi -else - echo - echo "Docker build failed. See output above." - echo - exit -1 -fi diff --git a/docker/gen-bugzilla-slim-mysql8.sh b/docker/gen-bugzilla-slim-mysql8.sh deleted file mode 100644 index 2341f3360..000000000 --- a/docker/gen-bugzilla-slim-mysql8.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This Source Code Form is "Incompatible With Secondary Licenses", as -# defined by the Mozilla Public License, v. 2.0. - -if [ ! -e 'Makefile.PL' ]; then - echo - echo "Please run this from the root of the Bugzilla source tree." - echo - exit -1 -fi -if [ -z "$DOCKER" ]; then - DOCKER=`which docker` -fi -if [ ! -x "$DOCKER" ]; then - echo - echo "You specified a custom Docker executable via the DOCKER" - echo "environment variable at $DOCKER" - echo "which either does not exist or is not executable." - echo "Please fix it to point at a working Docker or remove the" - echo "DOCKER environment variable to use the one in your PATH" - echo "if it exists." - echo - exit -1 -fi -if [ -z "$DOCKER" ]; then - echo - echo "You do not appear to have docker installed or I can't find it." - echo "Windows and Mac versions can be downloaded from" - echo "https://www.docker.com/products/docker-desktop" - echo "Linux users can install using your package manager." - echo - echo "Please install docker or specify the location of the docker" - echo "executable in the DOCKER environment variable and try again." - echo - exit -1 -fi -$DOCKER info 1>/dev/null 2>/dev/null -if [ $? != 0 ]; then - echo - echo "The docker daemon is not running or I can't connect to it." - echo "Please make sure it's running and try again." - echo - exit -1 -fi -if [ ! -f "docker/images/Dockerfile.bugzilla-mysql8" ]; then - echo - echo "Can't locate the Dockerfile, try running from the root of" - echo "your Bugzilla checkout." - echo - exit -1 -fi - -export DOCKER_CLI_HINTS=false -export CI="" -export CIRCLE_SHA1="" -export CIRCLE_BUILD_URL="" - -# Figure out the tag name to use for the image. We'll do this by generating -# a code based on today's date, then attempt to pull it from DockerHub. If -# we successfully pull, then it already exists, and we bump the interation -# number on the end. -DATE=`date +"%Y%m%d"` -ITER=1 -$DOCKER pull bugzilla/bugzilla-perl-slim-mysql8:${DATE}.${ITER} >/dev/null 2>/dev/null -while [ $? == 0 ]; do - # as long as we succesfully pull, keep bumping the number on the end - ((ITER++)) - $DOCKER pull bugzilla/bugzilla-perl-slim-mysql8:${DATE}.${ITER} >/dev/null 2>/dev/null -done -$DOCKER build -t bugzilla/bugzilla-perl-slim-mysql8:${DATE}.${ITER} -f docker/images/Dockerfile.bugzilla-mysql8 . -if [ $? == 0 ]; then - echo - echo "The build appears to have succeeded. Don't forget to change the FROM line" - echo "at the top of Dockerfile to use:" - echo " bugzilla/bugzilla-perl-slim-mysql8:${DATE}.${ITER}" - echo "to make use of this image." - echo - # check if the user is logged in - if [ -z "$PYTHON" ]; then - PYTHON=`which python` - fi - if [ -z "$PYTHON" ]; then - PYTHON=`which python3` - fi - if [ ! -x "$PYTHON" ]; then - echo "The python executable specified in your PYTHON environment value or your PATH is not executable or I can't find it." - exit -1 - fi - AUTHINFO=`$PYTHON -c "import json; print(len(json.load(open('${HOME}/.docker/config.json','r',encoding='utf-8'))['auths']))"` - if [ $AUTHINFO -gt 0 ]; then - # user is logged in - read -p "Do you wish to push to DockerHub? [y/N]: " yesno - case $yesno in - [Yy]*) - echo "Pushing..." - $DOCKER push bugzilla/bugzilla-perl-slim-mysql8:${DATE}.${ITER} - ;; - *) - echo "Not pushing. You can just run this script again when you're ready" - echo "to push. The prior build result is cached." - ;; - esac - fi -else - echo - echo "Docker build failed. See output above." - echo - exit -1 -fi diff --git a/docker/gen-bugzilla-slim-pg9.sh b/docker/gen-bugzilla-slim-pg9.sh deleted file mode 100644 index 92710d55c..000000000 --- a/docker/gen-bugzilla-slim-pg9.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This Source Code Form is "Incompatible With Secondary Licenses", as -# defined by the Mozilla Public License, v. 2.0. - -if [ ! -e 'Makefile.PL' ]; then - echo - echo "Please run this from the root of the Bugzilla source tree." - echo - exit -1 -fi -if [ -z "$DOCKER" ]; then - DOCKER=`which docker` -fi -if [ ! -x "$DOCKER" ]; then - echo - echo "You specified a custom Docker executable via the DOCKER" - echo "environment variable at $DOCKER" - echo "which either does not exist or is not executable." - echo "Please fix it to point at a working Docker or remove the" - echo "DOCKER environment variable to use the one in your PATH" - echo "if it exists." - echo - exit -1 -fi -if [ -z "$DOCKER" ]; then - echo - echo "You do not appear to have docker installed or I can't find it." - echo "Windows and Mac versions can be downloaded from" - echo "https://www.docker.com/products/docker-desktop" - echo "Linux users can install using your package manager." - echo - echo "Please install docker or specify the location of the docker" - echo "executable in the DOCKER environment variable and try again." - echo - exit -1 -fi -$DOCKER info 1>/dev/null 2>/dev/null -if [ $? != 0 ]; then - echo - echo "The docker daemon is not running or I can't connect to it." - echo "Please make sure it's running and try again." - echo - exit -1 -fi -if [ ! -f "docker/images/Dockerfile.bugzilla-pg9" ]; then - echo - echo "Can't locate the Dockerfile, try running from the root of" - echo "your Bugzilla checkout." - echo - exit -1 -fi - -export DOCKER_CLI_HINTS=false -export CI="" -export CIRCLE_SHA1="" -export CIRCLE_BUILD_URL="" - -# Figure out the tag name to use for the image. We'll do this by generating -# a code based on today's date, then attempt to pull it from DockerHub. If -# we successfully pull, then it already exists, and we bump the interation -# number on the end. -DATE=`date +"%Y%m%d"` -ITER=1 -$DOCKER pull bugzilla/bugzilla-perl-slim-pg9:${DATE}.${ITER} >/dev/null 2>/dev/null -while [ $? == 0 ]; do - # as long as we succesfully pull, keep bumping the number on the end - ((ITER++)) - $DOCKER pull bugzilla/bugzilla-perl-slim-pg9:${DATE}.${ITER} >/dev/null 2>/dev/null -done -$DOCKER build -t bugzilla/bugzilla-perl-slim-pg9:${DATE}.${ITER} -f docker/images/Dockerfile.bugzilla-pg9 . -if [ $? == 0 ]; then - echo - echo "The build appears to have succeeded. Don't forget to change the FROM line" - echo "at the top of Dockerfile to use:" - echo " bugzilla/bugzilla-perl-slim-pg9:${DATE}.${ITER}" - echo "to make use of this image." - echo - # check if the user is logged in - if [ -z "$PYTHON" ]; then - PYTHON=`which python` - fi - if [ -z "$PYTHON" ]; then - PYTHON=`which python3` - fi - if [ ! -x "$PYTHON" ]; then - echo "The python executable specified in your PYTHON environment value or your PATH is not executable or I can't find it." - exit -1 - fi - AUTHINFO=`$PYTHON -c "import json; print(len(json.load(open('${HOME}/.docker/config.json','r',encoding='utf-8'))['auths']))"` - if [ $AUTHINFO -gt 0 ]; then - # user is logged in - read -p "Do you wish to push to DockerHub? [y/N]: " yesno - case $yesno in - [Yy]*) - echo "Pushing..." - $DOCKER push bugzilla/bugzilla-perl-slim-pg9:${DATE}.${ITER} - ;; - *) - echo "Not pushing. You can just run this script again when you're ready" - echo "to push. The prior build result is cached." - ;; - esac - fi -else - echo - echo "Docker build failed. See output above." - echo - exit -1 -fi diff --git a/docker/gen-docker-image.sh b/docker/gen-docker-image.sh new file mode 100755 index 000000000..1268d23d2 --- /dev/null +++ b/docker/gen-docker-image.sh @@ -0,0 +1,121 @@ +#!/bin/bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This Source Code Form is "Incompatible With Secondary Licenses", as +# defined by the Mozilla Public License, v. 2.0. + +if [ ! -e 'Makefile.PL' ]; then + echo + echo "Please run this from the root of the Bugzilla source tree." + echo + exit -1 +fi +if [ -z "$DOCKER" ]; then + DOCKER=`which docker` +fi +if [ ! -x "$DOCKER" ]; then + echo + echo "You specified a custom Docker executable via the DOCKER" + echo "environment variable at $DOCKER" + echo "which either does not exist or is not executable." + echo "Please fix it to point at a working Docker or remove the" + echo "DOCKER environment variable to use the one in your PATH" + echo "if it exists." + echo + exit -1 +fi +if [ -z "$DOCKER" ]; then + echo + echo "You do not appear to have docker installed or I can't find it." + echo "Windows and Mac versions can be downloaded from" + echo "https://www.docker.com/products/docker-desktop" + echo "Linux users can install using your package manager." + echo + echo "Please install docker or specify the location of the docker" + echo "executable in the DOCKER environment variable and try again." + echo + exit -1 +fi +$DOCKER info 1>/dev/null 2>/dev/null +if [ $? != 0 ]; then + echo + echo "The docker daemon is not running or I can't connect to it." + echo "Please make sure it's running and try again." + echo + exit -1 +fi +FILES=`ls -1 docker/images/Dockerfile.b* | sed -e 's@^docker/images/Dockerfile\.@@'` +PS3="Choose an image to build or CTRL-C to abort: " +select IMAGE in $FILES; do + CACHE="" + if [ "$1" == "--no-cache" ]; then + CACHE="--no-cache" + fi + + export DOCKER_CLI_HINTS=false + export CI="" + export CIRCLE_SHA1="" + export CIRCLE_BUILD_URL="" + + # Figure out the tag name to use for the image. We'll do this by generating + # a code based on today's date, then attempt to pull it from DockerHub. If + # we successfully pull, then it already exists, and we bump the interation + # number on the end. + DATE=`date +"%Y%m%d"` + ITER=1 + $DOCKER pull bugzilla/${IMAGE}:${DATE}.${ITER} >/dev/null 2>/dev/null + while [ $? == 0 ]; do + # as long as we succesfully pull, keep bumping the number on the end + ((ITER++)) + $DOCKER pull bugzilla/${IMAGE}:${DATE}.${ITER} >/dev/null 2>/dev/null + done + LINE="Building bugzilla/${IMAGE}:${DATE}.${ITER}" + echo "##${LINE//?/#}##" + echo "# ${LINE} #" + echo "##${LINE//?/#}##" + $DOCKER build $CACHE -t bugzilla/${IMAGE}:${DATE}.${ITER} -f docker/images/Dockerfile.${IMAGE} . + if [ $? == 0 ]; then + echo + echo "The build appears to have succeeded. Don't forget to change the FROM line" + echo "at the top of Dockerfile to use:" + echo " bugzilla/${IMAGE}:${DATE}.${ITER}" + echo "to make use of this image." + echo + # check if the user is logged in + if [ -z "$PYTHON" ]; then + PYTHON=`which python` + fi + if [ -z "$PYTHON" ]; then + PYTHON=`which python3` + fi + if [ ! -x "$PYTHON" ]; then + echo "The python executable specified in your PYTHON environment value or your PATH is not executable or I can't find it." + exit -1 + fi + AUTHINFO=`$PYTHON -c "import json; print(len(json.load(open('${HOME}/.docker/config.json','r',encoding='utf-8'))['auths']))"` + if [ $AUTHINFO -gt 0 ]; then + # user is logged in + read -p "Do you wish to push to DockerHub? [y/N]: " yesno + case $yesno in + [Yy]*) + echo "Pushing..." + $DOCKER push bugzilla/${IMAGE}:${DATE}.${ITER} + $DOCKER tag bugzilla/${IMAGE}:${DATE}.${ITER} bugzilla/${IMAGE}:latest + $DOCKER push bugzilla/${IMAGE}:latest + ;; + *) + echo "Not pushing. You can just run this script again when you're ready" + echo "to push. The prior build result is cached." + ;; + esac + fi + else + echo + echo "Docker build failed. See output above." + echo + exit -1 + fi + break +done diff --git a/docker/images/Dockerfile.bugzilla-slim b/docker/images/Dockerfile.bugzilla-perl-slim similarity index 95% rename from docker/images/Dockerfile.bugzilla-slim rename to docker/images/Dockerfile.bugzilla-perl-slim index 8553134c1..bd4258ed0 100644 --- a/docker/images/Dockerfile.bugzilla-slim +++ b/docker/images/Dockerfile.bugzilla-perl-slim @@ -1,4 +1,4 @@ -FROM perl:5.38.0-slim AS builder +FROM perl:5.38.2-slim AS builder RUN apt-get update \ && apt-get dist-upgrade -y \ @@ -6,6 +6,7 @@ RUN apt-get update \ apt-file \ build-essential \ cmake \ + cpanminus \ curl \ git \ libcairo-dev \ @@ -40,7 +41,7 @@ RUN find local -name '*.so' -exec ldd {} \; \ | xargs -IFILE apt-file search -l FILE \ | sort -u > PACKAGES -FROM perl:5.38.0-slim +FROM perl:5.38.2-slim ENV DEBIAN_FRONTEND noninteractive diff --git a/docker/images/Dockerfile.bugzilla-mariadb106 b/docker/images/Dockerfile.bugzilla-perl-slim-mariadb similarity index 91% rename from docker/images/Dockerfile.bugzilla-mariadb106 rename to docker/images/Dockerfile.bugzilla-perl-slim-mariadb index 74b5dd5aa..d5acd77fe 100644 --- a/docker/images/Dockerfile.bugzilla-mariadb106 +++ b/docker/images/Dockerfile.bugzilla-perl-slim-mariadb @@ -1,4 +1,4 @@ -FROM bugzilla/bugzilla-perl-slim:20240410.1 AS builder +FROM bugzilla/bugzilla-perl-slim:20250925.1 AS builder RUN apt-get update \ && apt-get dist-upgrade -y \ @@ -38,7 +38,7 @@ RUN find local -name '*.so' -exec ldd {} \; \ | xargs -IFILE apt-file search -l FILE \ | sort -u > PACKAGES -FROM bugzilla/bugzilla-perl-slim:20240410.1 +FROM bugzilla/bugzilla-perl-slim:20250925.1 ENV DEBIAN_FRONTEND noninteractive diff --git a/docker/images/Dockerfile.bugzilla-mysql8 b/docker/images/Dockerfile.bugzilla-perl-slim-mysql similarity index 96% rename from docker/images/Dockerfile.bugzilla-mysql8 rename to docker/images/Dockerfile.bugzilla-perl-slim-mysql index 5d1dff9f6..a807fca41 100644 --- a/docker/images/Dockerfile.bugzilla-mysql8 +++ b/docker/images/Dockerfile.bugzilla-perl-slim-mysql @@ -1,4 +1,4 @@ -FROM bugzilla/bugzilla-perl-slim:20240410.1 AS builder +FROM bugzilla/bugzilla-perl-slim:20250925.1 AS builder RUN apt-get update \ && apt-get dist-upgrade -y \ @@ -6,6 +6,7 @@ RUN apt-get update \ apt-file \ build-essential \ cmake \ + cpanminus \ curl \ git \ libcairo-dev \ @@ -47,7 +48,7 @@ RUN find local -name '*.so' -exec ldd {} \; \ | xargs -IFILE apt-file search -l FILE \ | sort -u > PACKAGES -FROM bugzilla/bugzilla-perl-slim:20240410.1 +FROM bugzilla/bugzilla-perl-slim:20250925.1 ENV DEBIAN_FRONTEND noninteractive diff --git a/docker/images/Dockerfile.bugzilla-pg9 b/docker/images/Dockerfile.bugzilla-perl-slim-pg similarity index 94% rename from docker/images/Dockerfile.bugzilla-pg9 rename to docker/images/Dockerfile.bugzilla-perl-slim-pg index 7698e8514..d2fe4b575 100644 --- a/docker/images/Dockerfile.bugzilla-pg9 +++ b/docker/images/Dockerfile.bugzilla-perl-slim-pg @@ -1,4 +1,4 @@ -FROM bugzilla/bugzilla-perl-slim:20240410.1 AS builder +FROM bugzilla/bugzilla-perl-slim:20250925.1 AS builder # reinstall the build prereqs on the temporary image RUN apt-get update \ @@ -49,7 +49,7 @@ RUN find local -name '*.so' -exec ldd {} \; \ # now we start over with a new image so the final image doesn't contain # developer tools -FROM bugzilla/bugzilla-perl-slim:20240410.1 +FROM bugzilla/bugzilla-perl-slim:20250925.1 ENV DEBIAN_FRONTEND noninteractive diff --git a/docker/images/Dockerfile.cpanfile b/docker/images/Dockerfile.cpanfile index 71d4ca1ce..e11ba000d 100644 --- a/docker/images/Dockerfile.cpanfile +++ b/docker/images/Dockerfile.cpanfile @@ -1,10 +1,10 @@ -FROM perl:5.38.0-slim +FROM perl:5.38.2-slim RUN apt-get update \ && apt-get dist-upgrade -y \ && apt-get install -y \ build-essential curl libssl-dev zlib1g-dev openssl \ - libexpat-dev cmake git libcairo-dev libgd-dev \ + libexpat-dev cmake cpanminus git libcairo-dev libgd-dev \ unzip wget # The Perl image is based on Debian, which doesn't have MySQL 8, and the diff --git a/docker/images/Dockerfile.mysql8 b/docker/images/Dockerfile.mysql8 deleted file mode 100644 index 522278de1..000000000 --- a/docker/images/Dockerfile.mysql8 +++ /dev/null @@ -1,3 +0,0 @@ -FROM mysql:8 -# We do this because we don't want everything in the docker/mysql folder, just the one -COPY docker/mysql/bugzilla-mysql8.cnf /etc/mysql/conf.d/