Skip to content

Commit 46e4947

Browse files
committed
Replace alpine by debian for GLPI CI images
1 parent 146c8ea commit 46e4947

File tree

4 files changed

+31
-58
lines changed

4 files changed

+31
-58
lines changed

.github/workflows/githubactions-php.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
include:
26-
- {base-image: "php:8.1-fpm-alpine3.19", php-version: "8.1"}
27-
- {base-image: "php:8.2-fpm-alpine3.19", php-version: "8.2"}
28-
- {base-image: "php:8.3-fpm-alpine3.19", php-version: "8.3"}
26+
- {base-image: "php:8.1-fpm-bullseye", php-version: "8.1"}
27+
- {base-image: "php:8.2-fpm-bullseye", php-version: "8.2"}
28+
- {base-image: "php:8.3-fpm-bullseye", php-version: "8.3"}
2929
steps:
3030
- name: "Set variables"
3131
run: |

githubactions-glpi/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ USER root
1414

1515
# Create a user with UID=1001 (the UID used by Github Actions runner) and give it ownership of the `/var/glpi` directory,
1616
# so it can checkout the plugin and create config/user files without ACL issues.
17-
RUN adduser -D -h /home/github-actions-runner -G glpi -u 1001 github-actions-runner \
17+
RUN useradd -m -d /home/github-actions-runner -g glpi -u 1001 github-actions-runner \
1818
&& chown -R github-actions-runner:glpi /var/glpi
1919

2020
USER github-actions-runner

githubactions-php-coverage/Dockerfile

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,9 @@ LABEL \
1111
USER root
1212

1313
RUN \
14-
# Update APK package list.
15-
apk update \
16-
\
17-
# Install PHP build dependencies.
18-
&& apk add --virtual .build-deps $PHPIZE_DEPS linux-headers \
19-
\
2014
# Install xdebug extension.
21-
&& pecl install xdebug \
15+
pecl install xdebug \
2216
&& docker-php-ext-enable xdebug \
23-
&& echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
24-
\
25-
# Remove PHP build dependencies.
26-
&& apk del -f .build-deps \
27-
\
28-
# Clean sources list.
29-
&& rm -rf /var/cache/apk/*
17+
&& echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
3018

3119
USER glpi

githubactions-php/Dockerfile

Lines changed: 25 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG BASE_IMAGE=php:fpm-alpine
1+
ARG BASE_IMAGE=php:fpm-bullseye
22

33

44
#####
@@ -18,32 +18,28 @@ LABEL \
1818
org.opencontainers.image.source="[email protected]:glpi-project/docker-images"
1919

2020
RUN \
21-
# Update APK package list.
22-
apk update \
23-
\
24-
# Install PHP build dependencies.
25-
&& apk add --virtual .build-deps $PHPIZE_DEPS \
21+
# Update package list.
22+
apt update \
2623
\
2724
# Install exif extension.
2825
&& docker-php-ext-install exif \
2926
\
3027
# Install GD PHP extension.
31-
&& apk add freetype-dev libjpeg-turbo-dev libpng-dev libwebp-dev \
28+
&& apt install --assume-yes --no-install-recommends --quiet libfreetype6-dev libjpeg-dev libpng-dev libwebp-dev \
3229
&& docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
3330
&& docker-php-ext-install gd \
3431
\
3532
# Install intl PHP extension.
36-
&& apk add icu-dev icu-data-full \
33+
&& apt install --assume-yes --no-install-recommends --quiet libicu-dev \
3734
&& docker-php-ext-install intl \
3835
\
3936
# Install ldap PHP extension.
40-
&& apk add --virtual .ldap-build-deps openldap-dev \
41-
&& apk add libldap \
37+
&& apt install --assume-yes --no-install-recommends --quiet libldap2-dev \
38+
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
4239
&& docker-php-ext-install ldap \
43-
&& apk del -f .ldap-build-deps \
4440
\
4541
# Install memcached PHP extension.
46-
&& apk add libmemcached-dev \
42+
&& apt install --assume-yes --no-install-recommends --quiet libmemcached-dev \
4743
&& pecl install memcached \
4844
&& docker-php-ext-enable memcached \
4945
\
@@ -58,14 +54,12 @@ RUN \
5854
&& docker-php-ext-enable redis \
5955
\
6056
# Install Zip PHP extension.
61-
# Zip extension configuration changed on PHP 7.4
62-
# see https://www.php.net/manual/en/zip.installation.php
63-
&& apk add libzip-dev \
57+
&& apt install --assume-yes --no-install-recommends --quiet libzip-dev \
6458
&& docker-php-ext-install zip \
6559
\
6660
# Install XMLRPC PHP extension.
6761
# Install from Github (extension should be available on PECL but is not)
68-
&& apk add libxml2-dev \
62+
&& apt install --assume-yes --no-install-recommends --quiet libxml2-dev \
6963
&& mkdir -p /tmp/xmlrpc \
7064
&& (curl -LsfS https://github.com/php/pecl-networking-xmlrpc/archive/0f782ffe52cebd0a65356427b7ab72d48b72d20c/xmlrpc-0f782ff.tar.gz | tar xvz -C "/tmp/xmlrpc" --strip 1) \
7165
&& docker-php-ext-configure /tmp/xmlrpc --with-xmlrpc \
@@ -85,41 +79,32 @@ RUN \
8579
&& rm /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini \
8680
\
8781
# Install nodejs and npm.
88-
&& apk add nodejs npm \
82+
&& apt install --assume-yes --no-install-recommends --quiet gnupg \
83+
&& mkdir -p /etc/apt/keyrings \
84+
&& curl --fail --silent --show-error --location https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor --output /etc/apt/keyrings/nodesource.gpg \
85+
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
86+
&& apt update \
87+
&& apt install --assume-yes --no-install-recommends --quiet nodejs \
8988
\
9089
# Install git and zip used by composer when fetching dependencies.
91-
&& apk add git unzip \
92-
\
93-
# Install gettext and perl used to validate locales extraction.
94-
&& apk add gettext \
95-
&& apk add perl \
96-
\
97-
# Install chromium-chromedriver used for front-end tests.
98-
&& apk add chromium-chromedriver \
99-
\
100-
# Install sudo that may be usefull to temporarly install upcoming required system components.
101-
&& apk add sudo \
102-
&& (echo "glpi ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/glpi) \
103-
\
104-
# Install bash that is used in some GLPI scripts.
105-
&& apk add bash \
90+
&& apt install --assume-yes --no-install-recommends --quiet git unzip \
10691
\
107-
# Install patch utility that may be usefull to patch dependencies.
108-
&& apk add patch \
92+
# Install gettext used for translation files.
93+
&& apt install --assume-yes --no-install-recommends --quiet gettext \
10994
\
110-
# Remove PHP build dependencies.
111-
&& apk del -f .build-deps \
95+
# Install Cypress dependencies
96+
&& apt install --assume-yes --no-install-recommends --quiet libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb \
11297
\
113-
# Clean sources list.
114-
&& rm -rf /var/cache/apk/*
98+
# Clean sources list
99+
&& rm -rf /var/lib/apt/lists/*
115100

116101
# Copy composer binary
117102
COPY --from=composer /usr/bin/composer /usr/bin/composer
118103

119104
# Create application volume (used to share data across jobs),
120105
# give its ownage to glpi user (1000:1000) and define it as base working dir
121-
RUN addgroup -g 1000 glpi \
122-
&& adduser -D -h /home/glpi -G glpi -u 1000 glpi \
106+
RUN addgroup -gid 1000 glpi \
107+
&& useradd -m -d /home/glpi -g glpi -u 1000 glpi \
123108
&& mkdir -p /var/glpi \
124109
&& chown glpi:glpi /var/glpi
125110
USER glpi

0 commit comments

Comments
 (0)