Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • Comptoir/comptoir-du-libre
  • fgangler/comptoir
2 results
Show changes
Showing
with 641 additions and 0 deletions
../lib/symlink_source/70_push_image.sh
\ No newline at end of file
../lib/symlink_source/80_builld_and_push_image.sh
\ No newline at end of file
FROM ubuntu:22.04
# System prerequisites
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get -y --no-install-recommends \
install git \
make \
gpg-agent \
software-properties-common \
ca-certificates \
curl \
zip \
unzip \
gpg && \
rm -rf /var/lib/apt/lists/*
# Allow to use another version of PHP than Ubuntu PHP version
# RUN add-apt-repository ppa:ondrej/php
# Webapp prerequisites - Install PHP and PHP extensions
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get -y --no-install-recommends \
install php8.1 \
php8.1-bcmath \
php8.1-curl \
php8.1-intl \
php8.1-mbstring \
php8.1-pgsql \
php8.1-sqlite3 \
php8.1-xdebug \
php8.1-xml \
php8.1-zip && \
rm -rf /var/lib/apt/lists/*
# PHP Xdebug extension is mandatory to use Infection tool
# Webapp prerequisites - Install COMPOSER
RUN curl -sSL https://getcomposer.org/installer --output composer-setup.php && \
php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
php composer-setup.php && \
rm -v composer-setup.php && \
chmod +x composer.phar && \
mv -v composer.phar /usr/local/bin/composer && \
composer -V
# QA prerequisites - Install Symfony CLI
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl -sS https://get.symfony.com/cli/installer | /bin/bash && \
mv /root/.symfony5/bin/symfony /usr/local/bin/symfony && \
symfony -V
# Caching of all PHP dependencies declared in composer.json files
WORKDIR "/php/"
RUN REPO=https://gitlab.adullact.net/Comptoir/comptoir-du-libre.git && \
pwd && \
git clone ${REPO} source-code && \
cd /php/source-code/webapp/ && \
composer install --no-progress \
--no-interaction \
--no-scripts && \
cd /php/source-code/bin/tools_via_composer/ && \
composer install --no-progress \
--no-interaction \
--no-scripts && \
mkdir -p /php/composer-cache/tools/ && \
mkdir -p /php/composer-cache/webapp/ && \
cp /php/source-code/bin/tools_via_composer/composer.json /php/composer-cache/tools/ && \
cp /php/source-code/bin/tools_via_composer/composer.lock /php/composer-cache/tools/ && \
cp -r /php/source-code/bin/tools_via_composer/vendor /php/composer-cache/tools/ && \
cd /php/composer-cache/tools/ && \
tar -czf vendor.tar.gz vendor/ && \
cp -r /php/source-code/webapp/composer.json /php/composer-cache/webapp/ && \
cp -r /php/source-code/webapp/composer.lock /php/composer-cache/webapp/ && \
cp -r /php/source-code/webapp/vendor /php/composer-cache/webapp/ && \
cd /php/composer-cache/webapp/ && \
tar -czf vendor.tar.gz vendor/ && \
rm -rf /php/composer-cache/webapp/vendor/ && \
rm -rf /php/composer-cache/tools/vendor/ && \
rm -rf /php/source-code/
# Display software versions
RUN echo "-------------------" >> /php/software-infos.txt && \
cat /etc/os-release >> /php/software-infos.txt && \
echo "-------------------" >> /php/software-infos.txt && \
php --version >> /php/software-infos.txt && \
echo "-------------------" >> /php/software-infos.txt && \
php -m >> /php/software-infos.txt && \
echo "-------------------" >> /php/software-infos.txt && \
composer -V >> /php/software-infos.txt && \
echo "-------------------" >> /php/software-infos.txt && \
symfony -V >> /php/software-infos.txt && \
echo "-------------------" >> /php/software-infos.txt && \
cat /php/software-infos.txt
# # DEBUG
# RUN ls -l /php/ && \
# ls -l /php/composer-cache/ && \
# ls -l /php/composer-cache/webapp && \
# cd /php/composer-cache/webapp && tar -xzf vendor.tar.gz && \
# ls -l /php/composer-cache/webapp && \
# ls -l /php/composer-cache/webapp/vendor && \
# ls -l /php/composer-cache/tools && \
# cd /php/composer-cache/tools && tar -xzf vendor.tar.gz && \
# ls -l /php/composer-cache/tools && \
# ls -l /php/composer-cache/tools/vendor
#
# # DEBUG Check cache
# RUN du -hs /root/.cache/composer/ && \
# du -hs /php/composer-cache/*
# Set Docker LABEL
LABEL version="1.0.0" \
description="CI Prerequisites : Ubuntu 22.04, PHP 8.1 (Ubuntu packages), Composer, Symfony-CLI, Xdebug and Make"
# CI Prerequisites : Ubuntu 22.04, PHP 8.1 (Ubuntu packages), Composer, Symfony-CLI, Xdebug and Make
**Table of contents**
[Toc]
-------------------------------------------------------
## CI Prerequisites
Docker image of CI Prerequisites :
- Ubuntu 22.04
- PHP **8.1** (`Ubuntu packages`)
- Composer
- Symfony-CLI
- Xdebug
- Make
-------------------------------------------------------
## To update Docker image
### Edit Dockerfile
Edit [Dockerfile](Dockerfile) according to your needs
and in addition you must to change in this file `LABEL version="1.0.0"`
following [semantic versioning](http://semver.org/) recommendations:
```shell script
MAJOR.MINOR.PATCH
# MAJOR ---> a breaking change (incompatible API changes)
# MINOR ---> add a new feature
# PATCH ---> fix a bug
```
```dockerfile
# Set Docker LABEL and display software versions
LABEL version="1.0.0" \
description="CI Prerequisites : Ubuntu 22.04, PHP 8.1 (Ubuntu packages), Composer, Symfony-CLI, Xdebug and Make"
```
### Build Docker image and push to container registry
Build new Docker image and push to [Gitlab container registry](https://gitlab.adullact.net/Comptoir/comptoir-du-libre/container_registry)
#### Configure variables in particular DOCKER_IMAGE_VERSION
```bash
# Configure variables
# in particular DOCKER_IMAGE_VERSION
# which must be identical to LABEL.version in Dockerfile
GITLAB_URI="gitlab.adullact.net:4567"
GITLAB_REPOSITORY="comptoir/comptoir-du-libre"
DOCKER_IMAGE_NAME="php-8.1_composer"
DOCKER_IMAGE_VERSION="v1.0.0" # must be identical to LABEL.version in Dockerfile
```
#### Build new Docker image (option 1: without docker cache)
Must be used to push a new Docker image (without Docker cache):
```bash
# Build new Docker image
docker images | grep "${DOCKER_IMAGE_NAME}"
docker build --no-cache --progress plain -t "${GITLAB_URI}/${GITLAB_REPOSITORY}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_VERSION}" .
docker images | grep "${DOCKER_IMAGE_NAME}"
```
#### Build new Docker image (option 2: with docker cache)
Useful for debugging (with Docker cache):
```bash
# Build new Docker image
docker build --progress plain -t "${GITLAB_URI}/${GITLAB_REPOSITORY}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_VERSION}" .
docker images | grep "${DOCKER_IMAGE_NAME}"
```
#### Push to Gitlab container registry
```bash
# Login to Gitlab
docker login "${GITLAB_URI}"
# Push to Gitlab container registry
docker push "${GITLAB_URI}/${GITLAB_REPOSITORY}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_VERSION}"
# Logout to remove Gitlab credentials from $HOME/.docker/config.json file
docker logout "${GITLAB_URI}"
```
#!/usr/bin/env bash
# shellcheck disable=SC2034 # Don't warn about unused variables in this file
##############################################################################################
DOCKER_IMAGE_FROM="ubuntu:22.04"
DOCKER_IMAGE_NAME="php-8.1_composer"
DOCKER_IMAGE_VERSION="1.0.0" # must be identical to LABEL.version in Dockerfile
##############################################################################################
../lib/symlink_source/50_build_image_with-cache.sh
\ No newline at end of file
../lib/symlink_source/60_build_image_without-cache.sh
\ No newline at end of file
../lib/symlink_source/70_push_image.sh
\ No newline at end of file
../lib/symlink_source/80_builld_and_push_image.sh
\ No newline at end of file
FROM ubuntu:22.04
# System prerequisites
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get -y --no-install-recommends \
install git \
make \
gpg-agent \
software-properties-common \
ca-certificates \
curl \
zip \
unzip \
gpg && \
rm -rf /var/lib/apt/lists/*
# Allow to use another version of PHP than Ubuntu PHP version
RUN add-apt-repository ppa:ondrej/php
# Webapp prerequisites - Install PHP and PHP extensions
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get -y --no-install-recommends \
install php8.2 \
php8.2-bcmath \
php8.2-curl \
php8.2-intl \
php8.2-mbstring \
php8.2-pgsql \
php8.2-sqlite3 \
php8.2-xdebug \
php8.2-xml \
php8.2-zip && \
rm -rf /var/lib/apt/lists/*
# PHP Xdebug extension is mandatory to use Infection tool
# Webapp prerequisites - Install COMPOSER
RUN curl -sSL https://getcomposer.org/installer --output composer-setup.php && \
php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
php composer-setup.php && \
rm -v composer-setup.php && \
chmod +x composer.phar && \
mv -v composer.phar /usr/local/bin/composer && \
composer -V
# QA prerequisites - Install Symfony CLI
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl -sS https://get.symfony.com/cli/installer | /bin/bash && \
mv /root/.symfony5/bin/symfony /usr/local/bin/symfony && \
symfony -V
# Caching of all PHP dependencies declared in composer.json files
WORKDIR "/php/"
RUN REPO=https://gitlab.adullact.net/Comptoir/comptoir-du-libre.git && \
pwd && \
git clone ${REPO} source-code && \
cd /php/source-code/webapp/ && \
composer install --no-progress \
--no-interaction \
--no-scripts && \
cd /php/source-code/bin/tools_via_composer/ && \
composer install --no-progress \
--no-interaction \
--no-scripts && \
mkdir -p /php/composer-cache/tools/ && \
mkdir -p /php/composer-cache/webapp/ && \
cp /php/source-code/bin/tools_via_composer/composer.json /php/composer-cache/tools/ && \
cp /php/source-code/bin/tools_via_composer/composer.lock /php/composer-cache/tools/ && \
cp -r /php/source-code/bin/tools_via_composer/vendor /php/composer-cache/tools/ && \
cd /php/composer-cache/tools/ && \
tar -czf vendor.tar.gz vendor/ && \
cp -r /php/source-code/webapp/composer.json /php/composer-cache/webapp/ && \
cp -r /php/source-code/webapp/composer.lock /php/composer-cache/webapp/ && \
cp -r /php/source-code/webapp/vendor /php/composer-cache/webapp/ && \
cd /php/composer-cache/webapp/ && \
tar -czf vendor.tar.gz vendor/ && \
rm -rf /php/composer-cache/webapp/vendor/ && \
rm -rf /php/composer-cache/tools/vendor/ && \
rm -rf /php/source-code/
# Display software versions
RUN echo "-------------------" >> /php/software-infos.txt && \
cat /etc/os-release >> /php/software-infos.txt && \
echo "-------------------" >> /php/software-infos.txt && \
php --version >> /php/software-infos.txt && \
echo "-------------------" >> /php/software-infos.txt && \
php -m >> /php/software-infos.txt && \
echo "-------------------" >> /php/software-infos.txt && \
composer -V >> /php/software-infos.txt && \
echo "-------------------" >> /php/software-infos.txt && \
symfony -V >> /php/software-infos.txt && \
echo "-------------------" >> /php/software-infos.txt && \
cat /php/software-infos.txt
# # DEBUG
# RUN ls -l /php/ && \
# ls -l /php/composer-cache/ && \
# ls -l /php/composer-cache/webapp && \
# cd /php/composer-cache/webapp && tar -xzf vendor.tar.gz && \
# ls -l /php/composer-cache/webapp && \
# ls -l /php/composer-cache/webapp/vendor && \
# ls -l /php/composer-cache/tools && \
# cd /php/composer-cache/tools && tar -xzf vendor.tar.gz && \
# ls -l /php/composer-cache/tools && \
# ls -l /php/composer-cache/tools/vendor
#
# # DEBUG Check cache
# RUN du -hs /root/.cache/composer/ && \
# du -hs /php/composer-cache/*
# Set Docker LABEL
LABEL version="1.0.0" \
description="CI Prerequisites : Ubuntu 22.04, PHP 8.2 (ppa:ondrej/php), Composer, Symfony-CLI, Xdebug and Make"
# CI Prerequisites : Ubuntu 22.04, PHP 8.2 (ppa:ondrej/php), Composer, Symfony-CLI, Xdebug and Make
**Table of contents**
[Toc]
-------------------------------------------------------
## CI Prerequisites
Docker image of CI Prerequisites :
- Ubuntu 22.04
- PHP **8.2** (`ppa:ondrej/php`)
- Composer
- Symfony-CLI
- Xdebug
- Make
-------------------------------------------------------
## To update Docker image
### Edit Dockerfile
Edit [Dockerfile](Dockerfile) according to your needs
and in addition you must to change in this file `LABEL version="1.0.0"`
following [semantic versioning](http://semver.org/) recommendations:
```shell script
MAJOR.MINOR.PATCH
# MAJOR ---> a breaking change (incompatible API changes)
# MINOR ---> add a new feature
# PATCH ---> fix a bug
```
```dockerfile
# Set Docker LABEL and display software versions
LABEL version="1.0.0" \
description="CI Prerequisites : Ubuntu 22.04, PHP 8.2 (ppa:ondrej/php), Composer, Symfony-CLI, Xdebug and Make"
```
### Build Docker image and push to container registry
Build new Docker image and push to [Gitlab container registry](https://gitlab.adullact.net/Comptoir/comptoir-du-libre/container_registry)
#### Configure variables in particular DOCKER_IMAGE_VERSION
```bash
# Configure variables
# in particular DOCKER_IMAGE_VERSION
# which must be identical to LABEL.version in Dockerfile
GITLAB_URI="gitlab.adullact.net:4567"
GITLAB_REPOSITORY="comptoir/comptoir-du-libre"
DOCKER_IMAGE_NAME="php-8.2_composer"
DOCKER_IMAGE_VERSION="v1.0.0" # must be identical to LABEL.version in Dockerfile
```
#### Build new Docker image (option 1: without docker cache)
Must be used to push a new Docker image (without Docker cache):
```bash
# Build new Docker image
docker images | grep "${DOCKER_IMAGE_NAME}"
docker build --no-cache --progress plain -t "${GITLAB_URI}/${GITLAB_REPOSITORY}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_VERSION}" .
docker images | grep "${DOCKER_IMAGE_NAME}"
```
#### Build new Docker image (option 2: with docker cache)
Useful for debugging (with Docker cache):
```bash
# Build new Docker image
docker build --progress plain -t "${GITLAB_URI}/${GITLAB_REPOSITORY}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_VERSION}" .
docker images | grep "${DOCKER_IMAGE_NAME}"
```
#### Push to Gitlab container registry
```bash
# Login to Gitlab
docker login "${GITLAB_URI}"
# Push to Gitlab container registry
docker push "${GITLAB_URI}/${GITLAB_REPOSITORY}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_VERSION}"
# Logout to remove Gitlab credentials from $HOME/.docker/config.json file
docker logout "${GITLAB_URI}"
```
#!/usr/bin/env bash
# shellcheck disable=SC2034 # Don't warn about unused variables in this file
##############################################################################################
DOCKER_IMAGE_FROM="ubuntu:22.04"
DOCKER_IMAGE_NAME="php-8.2_composer"
DOCKER_IMAGE_VERSION="1.0.0" # must be identical to LABEL.version in Dockerfile
##############################################################################################
../lib/symlink_source/50_build_image_with-cache.sh
\ No newline at end of file
../lib/symlink_source/60_build_image_without-cache.sh
\ No newline at end of file
../lib/symlink_source/70_push_image.sh
\ No newline at end of file
../lib/symlink_source/80_builld_and_push_image.sh
\ No newline at end of file
FROM ubuntu:24.04
# System prerequisites
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get -y --no-install-recommends \
install git \
make \
gpg-agent \
software-properties-common \
ca-certificates \
curl \
zip \
unzip \
gpg && \
rm -rf /var/lib/apt/lists/*
# Allow to use another version of PHP than Ubuntu PHP version
# RUN add-apt-repository ppa:ondrej/php
# Webapp prerequisites - Install PHP and PHP extensions
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get -y --no-install-recommends \
install php8.3 \
php8.3-bcmath \
php8.3-curl \
php8.3-intl \
php8.3-mbstring \
php8.3-pgsql \
php8.3-sqlite3 \
php8.3-xdebug \
php8.3-xml \
php8.3-zip && \
rm -rf /var/lib/apt/lists/*
# PHP Xdebug extension is mandatory to use Infection tool
# Webapp prerequisites - Install COMPOSER
RUN curl -sSL https://getcomposer.org/installer --output composer-setup.php && \
php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
php composer-setup.php && \
rm -v composer-setup.php && \
chmod +x composer.phar && \
mv -v composer.phar /usr/local/bin/composer && \
composer -V
# QA prerequisites - Install Symfony CLI
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl -sS https://get.symfony.com/cli/installer | /bin/bash && \
mv /root/.symfony5/bin/symfony /usr/local/bin/symfony && \
symfony -V
# Caching of all PHP dependencies declared in composer.json files
WORKDIR "/php/"
RUN REPO=https://gitlab.adullact.net/Comptoir/comptoir-du-libre.git && \
pwd && \
git clone ${REPO} source-code && \
cd /php/source-code/webapp/ && \
composer install --no-progress \
--no-interaction \
--no-scripts && \
cd /php/source-code/bin/tools_via_composer/ && \
composer install --no-progress \
--no-interaction \
--no-scripts && \
mkdir -p /php/composer-cache/tools/ && \
mkdir -p /php/composer-cache/webapp/ && \
cp /php/source-code/bin/tools_via_composer/composer.json /php/composer-cache/tools/ && \
cp /php/source-code/bin/tools_via_composer/composer.lock /php/composer-cache/tools/ && \
cp -r /php/source-code/bin/tools_via_composer/vendor /php/composer-cache/tools/ && \
cd /php/composer-cache/tools/ && \
tar -czf vendor.tar.gz vendor/ && \
cp -r /php/source-code/webapp/composer.json /php/composer-cache/webapp/ && \
cp -r /php/source-code/webapp/composer.lock /php/composer-cache/webapp/ && \
cp -r /php/source-code/webapp/vendor /php/composer-cache/webapp/ && \
cd /php/composer-cache/webapp/ && \
tar -czf vendor.tar.gz vendor/ && \
rm -rf /php/composer-cache/webapp/vendor/ && \
rm -rf /php/composer-cache/tools/vendor/ && \
rm -rf /php/source-code/
# Display software versions
RUN echo "-------------------" >> /php/software-infos.txt && \
cat /etc/os-release >> /php/software-infos.txt && \
echo "-------------------" >> /php/software-infos.txt && \
php --version >> /php/software-infos.txt && \
echo "-------------------" >> /php/software-infos.txt && \
php -m >> /php/software-infos.txt && \
echo "-------------------" >> /php/software-infos.txt && \
composer -V >> /php/software-infos.txt && \
echo "-------------------" >> /php/software-infos.txt && \
symfony -V >> /php/software-infos.txt && \
echo "-------------------" >> /php/software-infos.txt && \
cat /php/software-infos.txt
# # DEBUG
# RUN ls -l /php/ && \
# ls -l /php/composer-cache/ && \
# ls -l /php/composer-cache/webapp && \
# cd /php/composer-cache/webapp && tar -xzf vendor.tar.gz && \
# ls -l /php/composer-cache/webapp && \
# ls -l /php/composer-cache/webapp/vendor && \
# ls -l /php/composer-cache/tools && \
# cd /php/composer-cache/tools && tar -xzf vendor.tar.gz && \
# ls -l /php/composer-cache/tools && \
# ls -l /php/composer-cache/tools/vendor
#
# # DEBUG Check cache
# RUN du -hs /root/.cache/composer/ && \
# du -hs /php/composer-cache/*
# Set Docker LABEL
LABEL version="1.0.0" \
description="CI Prerequisites : Ubuntu 24.04, PHP 8.3 (Ubuntu packages), Composer, Symfony-CLI, Xdebug and Make"
# CI Prerequisites : Ubuntu 24.04, PHP 8.3 (Ubuntu packages), Composer, Symfony-CLI, Xdebug and Make
**Table of contents**
[Toc]
-------------------------------------------------------
## CI Prerequisites
Docker image of CI Prerequisites :
- Ubuntu 24.04
- PHP **8.3** (`Ubuntu packages`)
- Composer
- Symfony-CLI
- Xdebug
- Make
-------------------------------------------------------
## To update Docker image
### Edit Dockerfile
Edit [Dockerfile](Dockerfile) according to your needs
and in addition you must to change in this file `LABEL version="1.0.0"`
following [semantic versioning](http://semver.org/) recommendations:
```shell script
MAJOR.MINOR.PATCH
# MAJOR ---> a breaking change (incompatible API changes)
# MINOR ---> add a new feature
# PATCH ---> fix a bug
```
```dockerfile
# Set Docker LABEL and display software versions
LABEL version="1.0.0" \
description="CI Prerequisites : Ubuntu 24.04, PHP 8.3 (Ubuntu packages), Composer, Symfony-CLI, Xdebug and Make"
```
### Build Docker image and push to container registry
Build new Docker image and push to [Gitlab container registry](https://gitlab.adullact.net/Comptoir/comptoir-du-libre/container_registry)
#### Configure variables in particular DOCKER_IMAGE_VERSION
```bash
# Configure variables
# in particular DOCKER_IMAGE_VERSION
# which must be identical to LABEL.version in Dockerfile
GITLAB_URI="gitlab.adullact.net:4567"
GITLAB_REPOSITORY="comptoir/comptoir-du-libre"
DOCKER_IMAGE_NAME="php-8.3_composer"
DOCKER_IMAGE_VERSION="v1.0.0" # must be identical to LABEL.version in Dockerfile
```
#### Build new Docker image (option 1: without docker cache)
Must be used to push a new Docker image (without Docker cache):
```bash
# Build new Docker image
docker images | grep "${DOCKER_IMAGE_NAME}"
docker build --no-cache --progress plain -t "${GITLAB_URI}/${GITLAB_REPOSITORY}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_VERSION}" .
docker images | grep "${DOCKER_IMAGE_NAME}"
```
#### Build new Docker image (option 2: with docker cache)
Useful for debugging (with Docker cache):
```bash
# Build new Docker image
docker build --progress plain -t "${GITLAB_URI}/${GITLAB_REPOSITORY}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_VERSION}" .
docker images | grep "${DOCKER_IMAGE_NAME}"
```
#### Push to Gitlab container registry
```bash
# Login to Gitlab
docker login "${GITLAB_URI}"
# Push to Gitlab container registry
docker push "${GITLAB_URI}/${GITLAB_REPOSITORY}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_VERSION}"
# Logout to remove Gitlab credentials from $HOME/.docker/config.json file
docker logout "${GITLAB_URI}"
```
#!/usr/bin/env bash
# shellcheck disable=SC2034 # Don't warn about unused variables in this file
##############################################################################################
DOCKER_IMAGE_FROM="ubuntu:24.04"
DOCKER_IMAGE_NAME="php-8.3_composer"
DOCKER_IMAGE_VERSION="1.0.0" # must be identical to LABEL.version in Dockerfile
##############################################################################################
../lib/symlink_source/50_build_image_with-cache.sh
\ No newline at end of file