From fea4bbcadfab1f3389933131d367db6eccc90b56 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 10 Mar 2025 11:52:24 +0100 Subject: [PATCH 1/8] Split command in seveal to debug pipeline CI error --- Dockerfile.template | 26 ++++++++++++++------------ update.sh | 4 ++-- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Dockerfile.template b/Dockerfile.template index 61b6104..910f089 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -52,7 +52,8 @@ RUN sed -i \ /etc/apache2/conf-available/security.conf RUN apt-get update -y \ - && apt-get dist-upgrade -y \ + && apt-get dist-upgrade -y +RUN apt-get update -y \ && apt-get install -y --no-install-recommends \ libc-client-dev \ libfreetype6-dev \ @@ -68,17 +69,18 @@ RUN apt-get update -y \ postgresql-client \ vim-tiny \ cron \ - && apt-get autoremove -y \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql gd soap zip opcache \ - && docker-php-ext-configure pgsql -with-pgsql \ - && docker-php-ext-install pdo_pgsql pgsql \ - && docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ \ - && docker-php-ext-install -j$(nproc) ldap \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && docker-php-ext-install imap \ - && mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini \ - && rm -rf /var/lib/apt/lists/* + && apt-get autoremove -y +RUN docker-php-ext-configure gd --with-freetype --with-jpeg +RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip curl xml +RUN docker-php-ext-install -j$(nproc) soap opcache +RUN docker-php-ext-configure pgsql -with-pgsql +RUN docker-php-ext-install pgsql +RUN docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ +RUN docker-php-ext-install -j$(nproc) ldap +RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl +RUN docker-php-ext-install imap +RUN mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini +RUN rm -rf /var/lib/apt/lists/* # Get Dolibarr RUN curl -fLSs https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.tar.gz |\ diff --git a/update.sh b/update.sh index 803611a..13e8abb 100755 --- a/update.sh +++ b/update.sh @@ -1,7 +1,7 @@ #!/bin/bash # -# Run this script to generate all files found into images directory, used for each image. -# The source files are the files into the root. +# Run this script to generate all files (Dockerfile, docker-init.php, docker-run.php) found into images directory, +# used for each image. The source files are the files into the root. # set -e From 24353cdba5a29015ace68243430207c94474b561 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 10 Mar 2025 11:56:11 +0100 Subject: [PATCH 2/8] Update files --- .github/workflows/build.yml | 9 ++++++--- images/15.0.3-php7.4/Dockerfile | 26 ++++++++++++++------------ images/16.0.5-php8.1/Dockerfile | 26 ++++++++++++++------------ images/17.0.4-php8.1/Dockerfile | 26 ++++++++++++++------------ images/18.0.6-php8.1/Dockerfile | 26 ++++++++++++++------------ images/19.0.4-php8.2/Dockerfile | 26 ++++++++++++++------------ images/20.0.4-php8.2/Dockerfile | 26 ++++++++++++++------------ images/develop/Dockerfile | 26 ++++++++++++++------------ 8 files changed, 104 insertions(+), 87 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3c0a211..7ea93cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,11 @@ name: build on: - push: - branches: - - main + #push: + # branches: + # - main + # can run job manually + workflow_dispatch: + # Run once a week schedule: - cron: '0 0 * * 6' diff --git a/images/15.0.3-php7.4/Dockerfile b/images/15.0.3-php7.4/Dockerfile index 12cab77..f00c5e5 100644 --- a/images/15.0.3-php7.4/Dockerfile +++ b/images/15.0.3-php7.4/Dockerfile @@ -52,7 +52,8 @@ RUN sed -i \ /etc/apache2/conf-available/security.conf RUN apt-get update -y \ - && apt-get dist-upgrade -y \ + && apt-get dist-upgrade -y +RUN apt-get update -y \ && apt-get install -y --no-install-recommends \ libc-client-dev \ libfreetype6-dev \ @@ -68,17 +69,18 @@ RUN apt-get update -y \ postgresql-client \ vim-tiny \ cron \ - && apt-get autoremove -y \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql gd soap zip opcache \ - && docker-php-ext-configure pgsql -with-pgsql \ - && docker-php-ext-install pdo_pgsql pgsql \ - && docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ \ - && docker-php-ext-install -j$(nproc) ldap \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && docker-php-ext-install imap \ - && mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini \ - && rm -rf /var/lib/apt/lists/* + && apt-get autoremove -y +RUN docker-php-ext-configure gd --with-freetype --with-jpeg +RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip curl xml +RUN docker-php-ext-install -j$(nproc) soap opcache +RUN docker-php-ext-configure pgsql -with-pgsql +RUN docker-php-ext-install pgsql +RUN docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ +RUN docker-php-ext-install -j$(nproc) ldap +RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl +RUN docker-php-ext-install imap +RUN mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini +RUN rm -rf /var/lib/apt/lists/* # Get Dolibarr RUN curl -fLSs https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.tar.gz |\ diff --git a/images/16.0.5-php8.1/Dockerfile b/images/16.0.5-php8.1/Dockerfile index 54066ac..435f08b 100644 --- a/images/16.0.5-php8.1/Dockerfile +++ b/images/16.0.5-php8.1/Dockerfile @@ -52,7 +52,8 @@ RUN sed -i \ /etc/apache2/conf-available/security.conf RUN apt-get update -y \ - && apt-get dist-upgrade -y \ + && apt-get dist-upgrade -y +RUN apt-get update -y \ && apt-get install -y --no-install-recommends \ libc-client-dev \ libfreetype6-dev \ @@ -68,17 +69,18 @@ RUN apt-get update -y \ postgresql-client \ vim-tiny \ cron \ - && apt-get autoremove -y \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql gd soap zip opcache \ - && docker-php-ext-configure pgsql -with-pgsql \ - && docker-php-ext-install pdo_pgsql pgsql \ - && docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ \ - && docker-php-ext-install -j$(nproc) ldap \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && docker-php-ext-install imap \ - && mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini \ - && rm -rf /var/lib/apt/lists/* + && apt-get autoremove -y +RUN docker-php-ext-configure gd --with-freetype --with-jpeg +RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip curl xml +RUN docker-php-ext-install -j$(nproc) soap opcache +RUN docker-php-ext-configure pgsql -with-pgsql +RUN docker-php-ext-install pgsql +RUN docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ +RUN docker-php-ext-install -j$(nproc) ldap +RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl +RUN docker-php-ext-install imap +RUN mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini +RUN rm -rf /var/lib/apt/lists/* # Get Dolibarr RUN curl -fLSs https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.tar.gz |\ diff --git a/images/17.0.4-php8.1/Dockerfile b/images/17.0.4-php8.1/Dockerfile index 6a2e5a4..bb9cb1c 100644 --- a/images/17.0.4-php8.1/Dockerfile +++ b/images/17.0.4-php8.1/Dockerfile @@ -52,7 +52,8 @@ RUN sed -i \ /etc/apache2/conf-available/security.conf RUN apt-get update -y \ - && apt-get dist-upgrade -y \ + && apt-get dist-upgrade -y +RUN apt-get update -y \ && apt-get install -y --no-install-recommends \ libc-client-dev \ libfreetype6-dev \ @@ -68,17 +69,18 @@ RUN apt-get update -y \ postgresql-client \ vim-tiny \ cron \ - && apt-get autoremove -y \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql gd soap zip opcache \ - && docker-php-ext-configure pgsql -with-pgsql \ - && docker-php-ext-install pdo_pgsql pgsql \ - && docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ \ - && docker-php-ext-install -j$(nproc) ldap \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && docker-php-ext-install imap \ - && mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini \ - && rm -rf /var/lib/apt/lists/* + && apt-get autoremove -y +RUN docker-php-ext-configure gd --with-freetype --with-jpeg +RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip curl xml +RUN docker-php-ext-install -j$(nproc) soap opcache +RUN docker-php-ext-configure pgsql -with-pgsql +RUN docker-php-ext-install pgsql +RUN docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ +RUN docker-php-ext-install -j$(nproc) ldap +RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl +RUN docker-php-ext-install imap +RUN mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini +RUN rm -rf /var/lib/apt/lists/* # Get Dolibarr RUN curl -fLSs https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.tar.gz |\ diff --git a/images/18.0.6-php8.1/Dockerfile b/images/18.0.6-php8.1/Dockerfile index 7d07337..bfe823b 100644 --- a/images/18.0.6-php8.1/Dockerfile +++ b/images/18.0.6-php8.1/Dockerfile @@ -52,7 +52,8 @@ RUN sed -i \ /etc/apache2/conf-available/security.conf RUN apt-get update -y \ - && apt-get dist-upgrade -y \ + && apt-get dist-upgrade -y +RUN apt-get update -y \ && apt-get install -y --no-install-recommends \ libc-client-dev \ libfreetype6-dev \ @@ -68,17 +69,18 @@ RUN apt-get update -y \ postgresql-client \ vim-tiny \ cron \ - && apt-get autoremove -y \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql gd soap zip opcache \ - && docker-php-ext-configure pgsql -with-pgsql \ - && docker-php-ext-install pdo_pgsql pgsql \ - && docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ \ - && docker-php-ext-install -j$(nproc) ldap \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && docker-php-ext-install imap \ - && mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini \ - && rm -rf /var/lib/apt/lists/* + && apt-get autoremove -y +RUN docker-php-ext-configure gd --with-freetype --with-jpeg +RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip curl xml +RUN docker-php-ext-install -j$(nproc) soap opcache +RUN docker-php-ext-configure pgsql -with-pgsql +RUN docker-php-ext-install pgsql +RUN docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ +RUN docker-php-ext-install -j$(nproc) ldap +RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl +RUN docker-php-ext-install imap +RUN mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini +RUN rm -rf /var/lib/apt/lists/* # Get Dolibarr RUN curl -fLSs https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.tar.gz |\ diff --git a/images/19.0.4-php8.2/Dockerfile b/images/19.0.4-php8.2/Dockerfile index 5d60155..b218480 100644 --- a/images/19.0.4-php8.2/Dockerfile +++ b/images/19.0.4-php8.2/Dockerfile @@ -52,7 +52,8 @@ RUN sed -i \ /etc/apache2/conf-available/security.conf RUN apt-get update -y \ - && apt-get dist-upgrade -y \ + && apt-get dist-upgrade -y +RUN apt-get update -y \ && apt-get install -y --no-install-recommends \ libc-client-dev \ libfreetype6-dev \ @@ -68,17 +69,18 @@ RUN apt-get update -y \ postgresql-client \ vim-tiny \ cron \ - && apt-get autoremove -y \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql gd soap zip opcache \ - && docker-php-ext-configure pgsql -with-pgsql \ - && docker-php-ext-install pdo_pgsql pgsql \ - && docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ \ - && docker-php-ext-install -j$(nproc) ldap \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && docker-php-ext-install imap \ - && mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini \ - && rm -rf /var/lib/apt/lists/* + && apt-get autoremove -y +RUN docker-php-ext-configure gd --with-freetype --with-jpeg +RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip curl xml +RUN docker-php-ext-install -j$(nproc) soap opcache +RUN docker-php-ext-configure pgsql -with-pgsql +RUN docker-php-ext-install pgsql +RUN docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ +RUN docker-php-ext-install -j$(nproc) ldap +RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl +RUN docker-php-ext-install imap +RUN mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini +RUN rm -rf /var/lib/apt/lists/* # Get Dolibarr RUN curl -fLSs https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.tar.gz |\ diff --git a/images/20.0.4-php8.2/Dockerfile b/images/20.0.4-php8.2/Dockerfile index 8cf54a0..7c5eec4 100644 --- a/images/20.0.4-php8.2/Dockerfile +++ b/images/20.0.4-php8.2/Dockerfile @@ -52,7 +52,8 @@ RUN sed -i \ /etc/apache2/conf-available/security.conf RUN apt-get update -y \ - && apt-get dist-upgrade -y \ + && apt-get dist-upgrade -y +RUN apt-get update -y \ && apt-get install -y --no-install-recommends \ libc-client-dev \ libfreetype6-dev \ @@ -68,17 +69,18 @@ RUN apt-get update -y \ postgresql-client \ vim-tiny \ cron \ - && apt-get autoremove -y \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql gd soap zip opcache \ - && docker-php-ext-configure pgsql -with-pgsql \ - && docker-php-ext-install pdo_pgsql pgsql \ - && docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ \ - && docker-php-ext-install -j$(nproc) ldap \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && docker-php-ext-install imap \ - && mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini \ - && rm -rf /var/lib/apt/lists/* + && apt-get autoremove -y +RUN docker-php-ext-configure gd --with-freetype --with-jpeg +RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip curl xml +RUN docker-php-ext-install -j$(nproc) soap opcache +RUN docker-php-ext-configure pgsql -with-pgsql +RUN docker-php-ext-install pgsql +RUN docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ +RUN docker-php-ext-install -j$(nproc) ldap +RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl +RUN docker-php-ext-install imap +RUN mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini +RUN rm -rf /var/lib/apt/lists/* # Get Dolibarr RUN curl -fLSs https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.tar.gz |\ diff --git a/images/develop/Dockerfile b/images/develop/Dockerfile index 6bf5a5b..861efcd 100644 --- a/images/develop/Dockerfile +++ b/images/develop/Dockerfile @@ -52,7 +52,8 @@ RUN sed -i \ /etc/apache2/conf-available/security.conf RUN apt-get update -y \ - && apt-get dist-upgrade -y \ + && apt-get dist-upgrade -y +RUN apt-get update -y \ && apt-get install -y --no-install-recommends \ libc-client-dev \ libfreetype6-dev \ @@ -68,17 +69,18 @@ RUN apt-get update -y \ postgresql-client \ vim-tiny \ cron \ - && apt-get autoremove -y \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && docker-php-ext-install -j$(nproc) calendar intl mysqli pdo_mysql gd soap zip opcache \ - && docker-php-ext-configure pgsql -with-pgsql \ - && docker-php-ext-install pdo_pgsql pgsql \ - && docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ \ - && docker-php-ext-install -j$(nproc) ldap \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && docker-php-ext-install imap \ - && mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini \ - && rm -rf /var/lib/apt/lists/* + && apt-get autoremove -y +RUN docker-php-ext-configure gd --with-freetype --with-jpeg +RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip curl xml +RUN docker-php-ext-install -j$(nproc) soap opcache +RUN docker-php-ext-configure pgsql -with-pgsql +RUN docker-php-ext-install pgsql +RUN docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ +RUN docker-php-ext-install -j$(nproc) ldap +RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl +RUN docker-php-ext-install imap +RUN mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini +RUN rm -rf /var/lib/apt/lists/* # Get Dolibarr RUN curl -fLSs https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.tar.gz |\ From b9dac6129121b716c45dcba9655925ee8147757a Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 10 Mar 2025 12:08:58 +0100 Subject: [PATCH 3/8] Test --- .github/workflows/test.yml | 2 ++ Dockerfile.template | 3 ++- images/15.0.3-php7.4/Dockerfile | 3 ++- images/16.0.5-php8.1/Dockerfile | 3 ++- images/17.0.4-php8.1/Dockerfile | 3 ++- images/18.0.6-php8.1/Dockerfile | 3 ++- images/19.0.4-php8.2/Dockerfile | 3 ++- images/20.0.4-php8.2/Dockerfile | 3 ++- images/develop/Dockerfile | 3 ++- 9 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 40930a6..1355fc1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,9 @@ jobs: - env: DOLI_INSTALL_AUTO: 0 run: | + # Regenerate all the image files ./update.sh + # Try to build the image inimages/develop docker build -t dolibarr/dolibarr:develop images/develop docker run -d -p 127.0.0.1:80:80 --name dolibarr dolibarr/dolibarr:develop docker ps | grep -q dolibarr diff --git a/Dockerfile.template b/Dockerfile.template index 910f089..94ab068 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -69,9 +69,10 @@ RUN apt-get update -y \ postgresql-client \ vim-tiny \ cron \ + curl \ && apt-get autoremove -y RUN docker-php-ext-configure gd --with-freetype --with-jpeg -RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip curl xml +RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip xml RUN docker-php-ext-install -j$(nproc) soap opcache RUN docker-php-ext-configure pgsql -with-pgsql RUN docker-php-ext-install pgsql diff --git a/images/15.0.3-php7.4/Dockerfile b/images/15.0.3-php7.4/Dockerfile index f00c5e5..9744aac 100644 --- a/images/15.0.3-php7.4/Dockerfile +++ b/images/15.0.3-php7.4/Dockerfile @@ -69,9 +69,10 @@ RUN apt-get update -y \ postgresql-client \ vim-tiny \ cron \ + curl \ && apt-get autoremove -y RUN docker-php-ext-configure gd --with-freetype --with-jpeg -RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip curl xml +RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip xml RUN docker-php-ext-install -j$(nproc) soap opcache RUN docker-php-ext-configure pgsql -with-pgsql RUN docker-php-ext-install pgsql diff --git a/images/16.0.5-php8.1/Dockerfile b/images/16.0.5-php8.1/Dockerfile index 435f08b..3ee3e6a 100644 --- a/images/16.0.5-php8.1/Dockerfile +++ b/images/16.0.5-php8.1/Dockerfile @@ -69,9 +69,10 @@ RUN apt-get update -y \ postgresql-client \ vim-tiny \ cron \ + curl \ && apt-get autoremove -y RUN docker-php-ext-configure gd --with-freetype --with-jpeg -RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip curl xml +RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip xml RUN docker-php-ext-install -j$(nproc) soap opcache RUN docker-php-ext-configure pgsql -with-pgsql RUN docker-php-ext-install pgsql diff --git a/images/17.0.4-php8.1/Dockerfile b/images/17.0.4-php8.1/Dockerfile index bb9cb1c..9d2937c 100644 --- a/images/17.0.4-php8.1/Dockerfile +++ b/images/17.0.4-php8.1/Dockerfile @@ -69,9 +69,10 @@ RUN apt-get update -y \ postgresql-client \ vim-tiny \ cron \ + curl \ && apt-get autoremove -y RUN docker-php-ext-configure gd --with-freetype --with-jpeg -RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip curl xml +RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip xml RUN docker-php-ext-install -j$(nproc) soap opcache RUN docker-php-ext-configure pgsql -with-pgsql RUN docker-php-ext-install pgsql diff --git a/images/18.0.6-php8.1/Dockerfile b/images/18.0.6-php8.1/Dockerfile index bfe823b..16571ae 100644 --- a/images/18.0.6-php8.1/Dockerfile +++ b/images/18.0.6-php8.1/Dockerfile @@ -69,9 +69,10 @@ RUN apt-get update -y \ postgresql-client \ vim-tiny \ cron \ + curl \ && apt-get autoremove -y RUN docker-php-ext-configure gd --with-freetype --with-jpeg -RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip curl xml +RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip xml RUN docker-php-ext-install -j$(nproc) soap opcache RUN docker-php-ext-configure pgsql -with-pgsql RUN docker-php-ext-install pgsql diff --git a/images/19.0.4-php8.2/Dockerfile b/images/19.0.4-php8.2/Dockerfile index b218480..4d6fab8 100644 --- a/images/19.0.4-php8.2/Dockerfile +++ b/images/19.0.4-php8.2/Dockerfile @@ -69,9 +69,10 @@ RUN apt-get update -y \ postgresql-client \ vim-tiny \ cron \ + curl \ && apt-get autoremove -y RUN docker-php-ext-configure gd --with-freetype --with-jpeg -RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip curl xml +RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip xml RUN docker-php-ext-install -j$(nproc) soap opcache RUN docker-php-ext-configure pgsql -with-pgsql RUN docker-php-ext-install pgsql diff --git a/images/20.0.4-php8.2/Dockerfile b/images/20.0.4-php8.2/Dockerfile index 7c5eec4..f6b5ffd 100644 --- a/images/20.0.4-php8.2/Dockerfile +++ b/images/20.0.4-php8.2/Dockerfile @@ -69,9 +69,10 @@ RUN apt-get update -y \ postgresql-client \ vim-tiny \ cron \ + curl \ && apt-get autoremove -y RUN docker-php-ext-configure gd --with-freetype --with-jpeg -RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip curl xml +RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip xml RUN docker-php-ext-install -j$(nproc) soap opcache RUN docker-php-ext-configure pgsql -with-pgsql RUN docker-php-ext-install pgsql diff --git a/images/develop/Dockerfile b/images/develop/Dockerfile index 861efcd..59c0bb6 100644 --- a/images/develop/Dockerfile +++ b/images/develop/Dockerfile @@ -69,9 +69,10 @@ RUN apt-get update -y \ postgresql-client \ vim-tiny \ cron \ + curl \ && apt-get autoremove -y RUN docker-php-ext-configure gd --with-freetype --with-jpeg -RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip curl xml +RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip xml RUN docker-php-ext-install -j$(nproc) soap opcache RUN docker-php-ext-configure pgsql -with-pgsql RUN docker-php-ext-install pgsql From ead6a798efad3bb2311d1c3fa0bac5215d58c0a1 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 10 Mar 2025 12:37:27 +0100 Subject: [PATCH 4/8] More logs --- test.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/test.sh b/test.sh index 9b0f2ce..f361abf 100755 --- a/test.sh +++ b/test.sh @@ -14,8 +14,10 @@ DOLI_VER=${1} PHP_VER=${2:-""} if [ "${DOLI_VER}" = "" ]; then - echo "Usage: sudo test.sh develop" - echo " sudo test.sh 18.0.5 8.1" + echo "Usage: sudo test.sh dolversion [phpversion]" + echo " The couple dolversion/phpversion must be an existing couple into /images directory." + echo "Example: sudo test.sh develop" + echo " sudo test.sh 18.0.5 8.1" exit fi @@ -45,17 +47,23 @@ echo "Testing for:" echo " - Dolibarr ${DOLI_VER}" if [ "${PHP_VER}" = "" ]; then echo " - PHP most recent" - echo "Building image ..." + echo "Stopping existing image (if exists) ..." echo "DOLI_VERSION=${DOLI_VER} PHP_VERSION='' $dockerComposeBin -f '${BASE_DIR}/docker-compose.yml' [down|...]" DOLI_VERSION=${DOLI_VER} PHP_VERSION="" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" down 1>/dev/null + echo "Building image ..." DOLI_VERSION=${DOLI_VER} PHP_VERSION="" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" build web + echo "Starting image ..." DOLI_VERSION=${DOLI_VER} PHP_VERSION="" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" up --force-recreate web cron + echo "Stopping image ..." DOLI_VERSION=${DOLI_VER} PHP_VERSION="" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" down else echo " - PHP ${PHP_VER}" - echo "Building image ..." + echo "Stopping existing image (if exists) ..." DOLI_VERSION=${DOLI_VER} PHP_VERSION="-php${PHP_VER}" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" down 1>/dev/null + echo "Building image ..." DOLI_VERSION=${DOLI_VER} PHP_VERSION="-php${PHP_VER}" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" build web + echo "Starting image ..." DOLI_VERSION=${DOLI_VER} PHP_VERSION="-php${PHP_VER}" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" up --force-recreate web cron + echo "Stopping image ..." DOLI_VERSION=${DOLI_VER} PHP_VERSION="-php${PHP_VER}" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" down fi From 3bca2bc5be8061ef7582e22717693b42418e0452 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 10 Mar 2025 12:41:00 +0100 Subject: [PATCH 5/8] Test --- Dockerfile.template | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile.template b/Dockerfile.template index 94ab068..1de22e7 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -73,7 +73,8 @@ RUN apt-get update -y \ && apt-get autoremove -y RUN docker-php-ext-configure gd --with-freetype --with-jpeg RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip xml -RUN docker-php-ext-install -j$(nproc) soap opcache +RUN docker-php-ext-install -j$(nproc) soap +RUN docker-php-ext-install -j$(nproc) opcache RUN docker-php-ext-configure pgsql -with-pgsql RUN docker-php-ext-install pgsql RUN docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ From f159f60255bd48b0f05a502bfeb9a17bb5c51596 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 10 Mar 2025 12:43:39 +0100 Subject: [PATCH 6/8] Test --- images/15.0.3-php7.4/Dockerfile | 3 ++- images/16.0.5-php8.1/Dockerfile | 3 ++- images/17.0.4-php8.1/Dockerfile | 3 ++- images/18.0.6-php8.1/Dockerfile | 3 ++- images/19.0.4-php8.2/Dockerfile | 3 ++- images/20.0.4-php8.2/Dockerfile | 3 ++- images/develop/Dockerfile | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/images/15.0.3-php7.4/Dockerfile b/images/15.0.3-php7.4/Dockerfile index 9744aac..75bf6ce 100644 --- a/images/15.0.3-php7.4/Dockerfile +++ b/images/15.0.3-php7.4/Dockerfile @@ -73,7 +73,8 @@ RUN apt-get update -y \ && apt-get autoremove -y RUN docker-php-ext-configure gd --with-freetype --with-jpeg RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip xml -RUN docker-php-ext-install -j$(nproc) soap opcache +RUN docker-php-ext-install -j$(nproc) soap +RUN docker-php-ext-install -j$(nproc) opcache RUN docker-php-ext-configure pgsql -with-pgsql RUN docker-php-ext-install pgsql RUN docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ diff --git a/images/16.0.5-php8.1/Dockerfile b/images/16.0.5-php8.1/Dockerfile index 3ee3e6a..71715ae 100644 --- a/images/16.0.5-php8.1/Dockerfile +++ b/images/16.0.5-php8.1/Dockerfile @@ -73,7 +73,8 @@ RUN apt-get update -y \ && apt-get autoremove -y RUN docker-php-ext-configure gd --with-freetype --with-jpeg RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip xml -RUN docker-php-ext-install -j$(nproc) soap opcache +RUN docker-php-ext-install -j$(nproc) soap +RUN docker-php-ext-install -j$(nproc) opcache RUN docker-php-ext-configure pgsql -with-pgsql RUN docker-php-ext-install pgsql RUN docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ diff --git a/images/17.0.4-php8.1/Dockerfile b/images/17.0.4-php8.1/Dockerfile index 9d2937c..28a37d3 100644 --- a/images/17.0.4-php8.1/Dockerfile +++ b/images/17.0.4-php8.1/Dockerfile @@ -73,7 +73,8 @@ RUN apt-get update -y \ && apt-get autoremove -y RUN docker-php-ext-configure gd --with-freetype --with-jpeg RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip xml -RUN docker-php-ext-install -j$(nproc) soap opcache +RUN docker-php-ext-install -j$(nproc) soap +RUN docker-php-ext-install -j$(nproc) opcache RUN docker-php-ext-configure pgsql -with-pgsql RUN docker-php-ext-install pgsql RUN docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ diff --git a/images/18.0.6-php8.1/Dockerfile b/images/18.0.6-php8.1/Dockerfile index 16571ae..599bb0a 100644 --- a/images/18.0.6-php8.1/Dockerfile +++ b/images/18.0.6-php8.1/Dockerfile @@ -73,7 +73,8 @@ RUN apt-get update -y \ && apt-get autoremove -y RUN docker-php-ext-configure gd --with-freetype --with-jpeg RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip xml -RUN docker-php-ext-install -j$(nproc) soap opcache +RUN docker-php-ext-install -j$(nproc) soap +RUN docker-php-ext-install -j$(nproc) opcache RUN docker-php-ext-configure pgsql -with-pgsql RUN docker-php-ext-install pgsql RUN docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ diff --git a/images/19.0.4-php8.2/Dockerfile b/images/19.0.4-php8.2/Dockerfile index 4d6fab8..0286988 100644 --- a/images/19.0.4-php8.2/Dockerfile +++ b/images/19.0.4-php8.2/Dockerfile @@ -73,7 +73,8 @@ RUN apt-get update -y \ && apt-get autoremove -y RUN docker-php-ext-configure gd --with-freetype --with-jpeg RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip xml -RUN docker-php-ext-install -j$(nproc) soap opcache +RUN docker-php-ext-install -j$(nproc) soap +RUN docker-php-ext-install -j$(nproc) opcache RUN docker-php-ext-configure pgsql -with-pgsql RUN docker-php-ext-install pgsql RUN docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ diff --git a/images/20.0.4-php8.2/Dockerfile b/images/20.0.4-php8.2/Dockerfile index f6b5ffd..c38d55a 100644 --- a/images/20.0.4-php8.2/Dockerfile +++ b/images/20.0.4-php8.2/Dockerfile @@ -73,7 +73,8 @@ RUN apt-get update -y \ && apt-get autoremove -y RUN docker-php-ext-configure gd --with-freetype --with-jpeg RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip xml -RUN docker-php-ext-install -j$(nproc) soap opcache +RUN docker-php-ext-install -j$(nproc) soap +RUN docker-php-ext-install -j$(nproc) opcache RUN docker-php-ext-configure pgsql -with-pgsql RUN docker-php-ext-install pgsql RUN docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ diff --git a/images/develop/Dockerfile b/images/develop/Dockerfile index 59c0bb6..0e9c94a 100644 --- a/images/develop/Dockerfile +++ b/images/develop/Dockerfile @@ -73,7 +73,8 @@ RUN apt-get update -y \ && apt-get autoremove -y RUN docker-php-ext-configure gd --with-freetype --with-jpeg RUN docker-php-ext-install -j$(nproc) calendar intl mysqli gd zip xml -RUN docker-php-ext-install -j$(nproc) soap opcache +RUN docker-php-ext-install -j$(nproc) soap +RUN docker-php-ext-install -j$(nproc) opcache RUN docker-php-ext-configure pgsql -with-pgsql RUN docker-php-ext-install pgsql RUN docker-php-ext-configure ldap --with-libdir=lib/$(gcc -dumpmachine)/ From b8f85c1ca18a297b9a5d1dab8dbdc649adb8c6bc Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 10 Mar 2025 14:19:57 +0100 Subject: [PATCH 7/8] Fix the cron key is not save according to setup --- README.md | 3 +++ docker-run.sh | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 5601442..592f098 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ services: DOLI_ADMIN_LOGIN: "${DOLI_ADMIN_LOGIN:-admin}" DOLI_ADMIN_PASSWORD: "${DOLI_ADMIN_PASSWORD:-admin}" DOLI_CRON: ${DOLI_CRON:-0} + DOLI_CRON_KEY: ${DOLI_CRON_KEY:-mycronsecurekey} DOLI_INIT_DEMO: ${DOLI_INIT_DEMO:-0} DOLI_COMPANY_NAME: ${DOLI_COMPANY_NAME:-MyBigCompany} @@ -234,6 +235,8 @@ services: DOLI_URL_ROOT: "${DOLI_URL_ROOT:-http://0.0.0.0}" DOLI_ADMIN_LOGIN: "${DOLI_ADMIN_LOGIN:-admin}" DOLI_ADMIN_PASSWORD: "${DOLI_ADMIN_PASSWORD:-admin}" + DOLI_CRON: ${DOLI_CRON:-0} + DOLI_CRON_KEY: ${DOLI_CRON_KEY:-mycronsecurekey} DOLI_INIT_DEMO: ${DOLI_INIT_DEMO:-0} WWW_USER_ID: ${WWW_USER_ID:-1000} WWW_GROUP_ID: ${WWW_GROUP_ID:-1000} diff --git a/docker-run.sh b/docker-run.sh index 6c7fa81..3986f34 100755 --- a/docker-run.sh +++ b/docker-run.sh @@ -267,6 +267,10 @@ function initializeDatabase() echo "Enable user module ..." >> /var/www/documents/initdb.log php /var/www/scripts/docker-init.php + echo "Set cron key to ${DOLI_CRON_KEY}..." + echo "Set cron key to ${DOLI_CRON_KEY}..." >> /var/www/documents/initdb.log + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "UPDATE llx_const set value = '${DOLI_CRON_KEY}' WHERE name = 'CRON_KEY'" >> /var/www/documents/initdb.log 2>&1 + # Run init scripts echo "Run scripts into docker-init.d if there is ..." echo "Run scripts into docker-init.d if there is ..." >> /var/www/documents/initdb.log @@ -431,6 +435,8 @@ function run() echo "*** You can connect to the docker Mariadb with:" echo "sudo docker exec -it nameofwebcontainer-mariadb-1 bash" echo "mariadb -uroot -p'MYSQL_ROOT_PASSWORD' -h localhost" + echo "or" + echo "mariadb -uxxx -p'yyy' -h mariadb where xxx is in /run/secrets/mysql-user and yyy in /run/secrets/mysql-password" echo "ls /var/lib/mysql" echo echo "*** You can connect to the docker Dolibarr with:" From 2542b6b5688aadbdd897f50dd23d2eb7fe201029 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 10 Mar 2025 14:21:36 +0100 Subject: [PATCH 8/8] Fix the cron key is not save according to setup - Add more logs --- docker-compose.yml | 2 ++ examples/with-mysql/docker-compose.yml | 4 ++-- examples/with-secrets/secrets/mysql_password.secret | 2 +- examples/with-secrets/secrets/mysql_user.secret | 2 +- images/15.0.3-php7.4/docker-run.sh | 6 ++++++ images/16.0.5-php8.1/docker-run.sh | 6 ++++++ images/17.0.4-php8.1/docker-run.sh | 6 ++++++ images/18.0.6-php8.1/docker-run.sh | 6 ++++++ images/19.0.4-php8.2/docker-run.sh | 6 ++++++ images/20.0.4-php8.2/docker-run.sh | 6 ++++++ images/develop/docker-run.sh | 6 ++++++ test.sh | 7 +++++-- 12 files changed, 53 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 9ccb878..44be222 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,6 +31,7 @@ services: - mysql-user - mysql-password environment: + #MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root} MYSQL_RANDOM_ROOT_PASSWORD: "1" MYSQL_DATABASE: "dolidb" MYSQL_USER_FILE: "/run/secrets/mysql-user" @@ -86,6 +87,7 @@ services: DOLI_URL_ROOT: 'http://0.0.0.0:81' DOLI_INSTANCE_UNIQUE_ID: myinstanceuniqueid DOLI_INIT_DEMO: 1 + DOLI_CRON_KEY: mycronsecurekey ports: - "81:80" networks: diff --git a/examples/with-mysql/docker-compose.yml b/examples/with-mysql/docker-compose.yml index 69434bb..50a4753 100644 --- a/examples/with-mysql/docker-compose.yml +++ b/examples/with-mysql/docker-compose.yml @@ -15,8 +15,8 @@ services: environment: DOLI_DB_HOST: "mysql" DOLI_DB_HOST_PORT: "3306" - DOLI_DB_USER: "dolibarr" - DOLI_DB_PASSWORD: "mysupersecretpasswordfordatabase" + DOLI_DB_USER: "dolidbuser" + DOLI_DB_PASSWORD: "dolidbpass" DOLI_DB_NAME: "dolibarr" DOLI_ADMIN_LOGIN: "admin" DOLI_ADMIN_PASSWORD: "mysuperhypersecretpasswordforadminacount" diff --git a/examples/with-secrets/secrets/mysql_password.secret b/examples/with-secrets/secrets/mysql_password.secret index e00065a..5a752e5 100644 --- a/examples/with-secrets/secrets/mysql_password.secret +++ b/examples/with-secrets/secrets/mysql_password.secret @@ -1 +1 @@ -mysupersecretpasswordfordatabase \ No newline at end of file +dolidbpass \ No newline at end of file diff --git a/examples/with-secrets/secrets/mysql_user.secret b/examples/with-secrets/secrets/mysql_user.secret index 3d33aac..6df9168 100644 --- a/examples/with-secrets/secrets/mysql_user.secret +++ b/examples/with-secrets/secrets/mysql_user.secret @@ -1 +1 @@ -dolibarr \ No newline at end of file +dolidbuser \ No newline at end of file diff --git a/images/15.0.3-php7.4/docker-run.sh b/images/15.0.3-php7.4/docker-run.sh index 6c7fa81..3986f34 100755 --- a/images/15.0.3-php7.4/docker-run.sh +++ b/images/15.0.3-php7.4/docker-run.sh @@ -267,6 +267,10 @@ function initializeDatabase() echo "Enable user module ..." >> /var/www/documents/initdb.log php /var/www/scripts/docker-init.php + echo "Set cron key to ${DOLI_CRON_KEY}..." + echo "Set cron key to ${DOLI_CRON_KEY}..." >> /var/www/documents/initdb.log + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "UPDATE llx_const set value = '${DOLI_CRON_KEY}' WHERE name = 'CRON_KEY'" >> /var/www/documents/initdb.log 2>&1 + # Run init scripts echo "Run scripts into docker-init.d if there is ..." echo "Run scripts into docker-init.d if there is ..." >> /var/www/documents/initdb.log @@ -431,6 +435,8 @@ function run() echo "*** You can connect to the docker Mariadb with:" echo "sudo docker exec -it nameofwebcontainer-mariadb-1 bash" echo "mariadb -uroot -p'MYSQL_ROOT_PASSWORD' -h localhost" + echo "or" + echo "mariadb -uxxx -p'yyy' -h mariadb where xxx is in /run/secrets/mysql-user and yyy in /run/secrets/mysql-password" echo "ls /var/lib/mysql" echo echo "*** You can connect to the docker Dolibarr with:" diff --git a/images/16.0.5-php8.1/docker-run.sh b/images/16.0.5-php8.1/docker-run.sh index 6c7fa81..3986f34 100755 --- a/images/16.0.5-php8.1/docker-run.sh +++ b/images/16.0.5-php8.1/docker-run.sh @@ -267,6 +267,10 @@ function initializeDatabase() echo "Enable user module ..." >> /var/www/documents/initdb.log php /var/www/scripts/docker-init.php + echo "Set cron key to ${DOLI_CRON_KEY}..." + echo "Set cron key to ${DOLI_CRON_KEY}..." >> /var/www/documents/initdb.log + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "UPDATE llx_const set value = '${DOLI_CRON_KEY}' WHERE name = 'CRON_KEY'" >> /var/www/documents/initdb.log 2>&1 + # Run init scripts echo "Run scripts into docker-init.d if there is ..." echo "Run scripts into docker-init.d if there is ..." >> /var/www/documents/initdb.log @@ -431,6 +435,8 @@ function run() echo "*** You can connect to the docker Mariadb with:" echo "sudo docker exec -it nameofwebcontainer-mariadb-1 bash" echo "mariadb -uroot -p'MYSQL_ROOT_PASSWORD' -h localhost" + echo "or" + echo "mariadb -uxxx -p'yyy' -h mariadb where xxx is in /run/secrets/mysql-user and yyy in /run/secrets/mysql-password" echo "ls /var/lib/mysql" echo echo "*** You can connect to the docker Dolibarr with:" diff --git a/images/17.0.4-php8.1/docker-run.sh b/images/17.0.4-php8.1/docker-run.sh index 6c7fa81..3986f34 100755 --- a/images/17.0.4-php8.1/docker-run.sh +++ b/images/17.0.4-php8.1/docker-run.sh @@ -267,6 +267,10 @@ function initializeDatabase() echo "Enable user module ..." >> /var/www/documents/initdb.log php /var/www/scripts/docker-init.php + echo "Set cron key to ${DOLI_CRON_KEY}..." + echo "Set cron key to ${DOLI_CRON_KEY}..." >> /var/www/documents/initdb.log + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "UPDATE llx_const set value = '${DOLI_CRON_KEY}' WHERE name = 'CRON_KEY'" >> /var/www/documents/initdb.log 2>&1 + # Run init scripts echo "Run scripts into docker-init.d if there is ..." echo "Run scripts into docker-init.d if there is ..." >> /var/www/documents/initdb.log @@ -431,6 +435,8 @@ function run() echo "*** You can connect to the docker Mariadb with:" echo "sudo docker exec -it nameofwebcontainer-mariadb-1 bash" echo "mariadb -uroot -p'MYSQL_ROOT_PASSWORD' -h localhost" + echo "or" + echo "mariadb -uxxx -p'yyy' -h mariadb where xxx is in /run/secrets/mysql-user and yyy in /run/secrets/mysql-password" echo "ls /var/lib/mysql" echo echo "*** You can connect to the docker Dolibarr with:" diff --git a/images/18.0.6-php8.1/docker-run.sh b/images/18.0.6-php8.1/docker-run.sh index 6c7fa81..3986f34 100755 --- a/images/18.0.6-php8.1/docker-run.sh +++ b/images/18.0.6-php8.1/docker-run.sh @@ -267,6 +267,10 @@ function initializeDatabase() echo "Enable user module ..." >> /var/www/documents/initdb.log php /var/www/scripts/docker-init.php + echo "Set cron key to ${DOLI_CRON_KEY}..." + echo "Set cron key to ${DOLI_CRON_KEY}..." >> /var/www/documents/initdb.log + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "UPDATE llx_const set value = '${DOLI_CRON_KEY}' WHERE name = 'CRON_KEY'" >> /var/www/documents/initdb.log 2>&1 + # Run init scripts echo "Run scripts into docker-init.d if there is ..." echo "Run scripts into docker-init.d if there is ..." >> /var/www/documents/initdb.log @@ -431,6 +435,8 @@ function run() echo "*** You can connect to the docker Mariadb with:" echo "sudo docker exec -it nameofwebcontainer-mariadb-1 bash" echo "mariadb -uroot -p'MYSQL_ROOT_PASSWORD' -h localhost" + echo "or" + echo "mariadb -uxxx -p'yyy' -h mariadb where xxx is in /run/secrets/mysql-user and yyy in /run/secrets/mysql-password" echo "ls /var/lib/mysql" echo echo "*** You can connect to the docker Dolibarr with:" diff --git a/images/19.0.4-php8.2/docker-run.sh b/images/19.0.4-php8.2/docker-run.sh index 6c7fa81..3986f34 100755 --- a/images/19.0.4-php8.2/docker-run.sh +++ b/images/19.0.4-php8.2/docker-run.sh @@ -267,6 +267,10 @@ function initializeDatabase() echo "Enable user module ..." >> /var/www/documents/initdb.log php /var/www/scripts/docker-init.php + echo "Set cron key to ${DOLI_CRON_KEY}..." + echo "Set cron key to ${DOLI_CRON_KEY}..." >> /var/www/documents/initdb.log + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "UPDATE llx_const set value = '${DOLI_CRON_KEY}' WHERE name = 'CRON_KEY'" >> /var/www/documents/initdb.log 2>&1 + # Run init scripts echo "Run scripts into docker-init.d if there is ..." echo "Run scripts into docker-init.d if there is ..." >> /var/www/documents/initdb.log @@ -431,6 +435,8 @@ function run() echo "*** You can connect to the docker Mariadb with:" echo "sudo docker exec -it nameofwebcontainer-mariadb-1 bash" echo "mariadb -uroot -p'MYSQL_ROOT_PASSWORD' -h localhost" + echo "or" + echo "mariadb -uxxx -p'yyy' -h mariadb where xxx is in /run/secrets/mysql-user and yyy in /run/secrets/mysql-password" echo "ls /var/lib/mysql" echo echo "*** You can connect to the docker Dolibarr with:" diff --git a/images/20.0.4-php8.2/docker-run.sh b/images/20.0.4-php8.2/docker-run.sh index 6c7fa81..3986f34 100755 --- a/images/20.0.4-php8.2/docker-run.sh +++ b/images/20.0.4-php8.2/docker-run.sh @@ -267,6 +267,10 @@ function initializeDatabase() echo "Enable user module ..." >> /var/www/documents/initdb.log php /var/www/scripts/docker-init.php + echo "Set cron key to ${DOLI_CRON_KEY}..." + echo "Set cron key to ${DOLI_CRON_KEY}..." >> /var/www/documents/initdb.log + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "UPDATE llx_const set value = '${DOLI_CRON_KEY}' WHERE name = 'CRON_KEY'" >> /var/www/documents/initdb.log 2>&1 + # Run init scripts echo "Run scripts into docker-init.d if there is ..." echo "Run scripts into docker-init.d if there is ..." >> /var/www/documents/initdb.log @@ -431,6 +435,8 @@ function run() echo "*** You can connect to the docker Mariadb with:" echo "sudo docker exec -it nameofwebcontainer-mariadb-1 bash" echo "mariadb -uroot -p'MYSQL_ROOT_PASSWORD' -h localhost" + echo "or" + echo "mariadb -uxxx -p'yyy' -h mariadb where xxx is in /run/secrets/mysql-user and yyy in /run/secrets/mysql-password" echo "ls /var/lib/mysql" echo echo "*** You can connect to the docker Dolibarr with:" diff --git a/images/develop/docker-run.sh b/images/develop/docker-run.sh index 6c7fa81..3986f34 100755 --- a/images/develop/docker-run.sh +++ b/images/develop/docker-run.sh @@ -267,6 +267,10 @@ function initializeDatabase() echo "Enable user module ..." >> /var/www/documents/initdb.log php /var/www/scripts/docker-init.php + echo "Set cron key to ${DOLI_CRON_KEY}..." + echo "Set cron key to ${DOLI_CRON_KEY}..." >> /var/www/documents/initdb.log + mysql -u ${DOLI_DB_USER} -p${DOLI_DB_PASSWORD} -h ${DOLI_DB_HOST} -P ${DOLI_DB_HOST_PORT} ${DOLI_DB_NAME} -e "UPDATE llx_const set value = '${DOLI_CRON_KEY}' WHERE name = 'CRON_KEY'" >> /var/www/documents/initdb.log 2>&1 + # Run init scripts echo "Run scripts into docker-init.d if there is ..." echo "Run scripts into docker-init.d if there is ..." >> /var/www/documents/initdb.log @@ -431,6 +435,8 @@ function run() echo "*** You can connect to the docker Mariadb with:" echo "sudo docker exec -it nameofwebcontainer-mariadb-1 bash" echo "mariadb -uroot -p'MYSQL_ROOT_PASSWORD' -h localhost" + echo "or" + echo "mariadb -uxxx -p'yyy' -h mariadb where xxx is in /run/secrets/mysql-user and yyy in /run/secrets/mysql-password" echo "ls /var/lib/mysql" echo echo "*** You can connect to the docker Dolibarr with:" diff --git a/test.sh b/test.sh index f361abf..3888094 100755 --- a/test.sh +++ b/test.sh @@ -13,6 +13,8 @@ BASE_DIR="$( cd "$(dirname "$0")" && pwd )" DOLI_VER=${1} PHP_VER=${2:-""} +echo "Test - working in $BASE_DIR" + if [ "${DOLI_VER}" = "" ]; then echo "Usage: sudo test.sh dolversion [phpversion]" echo " The couple dolversion/phpversion must be an existing couple into /images directory." @@ -21,6 +23,7 @@ if [ "${DOLI_VER}" = "" ]; then exit fi +# Create links of images into docker-compose-links rm -rf "${BASE_DIR}/docker-compose-links/" && mkdir "${BASE_DIR}/docker-compose-links" # shellcheck disable=SC2044 @@ -50,7 +53,7 @@ if [ "${PHP_VER}" = "" ]; then echo "Stopping existing image (if exists) ..." echo "DOLI_VERSION=${DOLI_VER} PHP_VERSION='' $dockerComposeBin -f '${BASE_DIR}/docker-compose.yml' [down|...]" DOLI_VERSION=${DOLI_VER} PHP_VERSION="" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" down 1>/dev/null - echo "Building image ..." + echo "Building image using docker-compose.yml in $BASE_DIR..." DOLI_VERSION=${DOLI_VER} PHP_VERSION="" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" build web echo "Starting image ..." DOLI_VERSION=${DOLI_VER} PHP_VERSION="" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" up --force-recreate web cron @@ -60,7 +63,7 @@ else echo " - PHP ${PHP_VER}" echo "Stopping existing image (if exists) ..." DOLI_VERSION=${DOLI_VER} PHP_VERSION="-php${PHP_VER}" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" down 1>/dev/null - echo "Building image ..." + echo "Building image using docker-compose.yml in $BASE_DIR..." DOLI_VERSION=${DOLI_VER} PHP_VERSION="-php${PHP_VER}" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" build web echo "Starting image ..." DOLI_VERSION=${DOLI_VER} PHP_VERSION="-php${PHP_VER}" $dockerComposeBin -f "${BASE_DIR}/docker-compose.yml" up --force-recreate web cron