Skip to content

Commit 0dea233

Browse files
author
Tin Benjamin Matuka
committed
Added PHP 8.3
1 parent 9ffae5c commit 0dea233

File tree

5 files changed

+136
-1
lines changed

5 files changed

+136
-1
lines changed

build-configs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
PHP_VERSIONS="5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2"
3+
PHP_VERSIONS="5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3"
44

55
for PHP_VERSION in $PHP_VERSIONS;
66
do

packages-php8.3.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
php8.3
2+
php8.3-amqp
3+
php8.3-apcu
4+
php8.3-bcmath
5+
php8.3-bz2
6+
php8.3-cgi
7+
php8.3-cli
8+
php8.3-common
9+
php8.3-curl
10+
php8.3-dev
11+
php8.3-gd
12+
php8.3-gmp
13+
php8.3-imagick
14+
php8.3-imap
15+
php8.3-intl
16+
php8.3-ldap
17+
php8.3-mailparse
18+
php8.3-mbstring
19+
php8.3-memcached
20+
php8.3-mysql
21+
php8.3-odbc
22+
php8.3-opcache
23+
php8.3-pgsql
24+
php8.3-pspell
25+
php8.3-readline
26+
php8.3-redis
27+
php8.3-snmp
28+
php8.3-soap
29+
php8.3-sqlite3
30+
php8.3-tidy
31+
php8.3-uuid
32+
php8.3-xml
33+
php8.3-xsl
34+
php8.3-yaml
35+
php8.3-zip
36+
php8.3-zmq

php8.3/Dockerfile

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
FROM ubuntu:22.04
2+
3+
MAINTAINER Tin Benjamin Matuka <[email protected]>
4+
5+
# set up timezone
6+
ENV TIMEZONE="UTC"
7+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
8+
9+
# install deps, apache, php and php modules all in one run and clean up afterwards to reduce the snapshot size
10+
RUN apt-get clean && \
11+
apt-get -y update && \
12+
apt-get install -y --force-yes \
13+
locales \
14+
curl \
15+
software-properties-common \
16+
git \
17+
apt-transport-https \
18+
sudo \
19+
nvi \
20+
iproute2 \
21+
telnet \
22+
dnsutils \
23+
unzip \
24+
rsync \
25+
inetutils-ping && \
26+
locale-gen en_US.UTF-8 && \
27+
LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php && apt-get update && \
28+
DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes \
29+
imagemagick \
30+
php8.3 php8.3-amqp php8.3-apcu php8.3-bcmath php8.3-bz2 php8.3-cgi php8.3-cli php8.3-common php8.3-curl php8.3-dev php8.3-gd php8.3-gmp php8.3-imagick php8.3-imap php8.3-intl php8.3-ldap php8.3-mailparse php8.3-mbstring php8.3-memcached php8.3-mysql php8.3-odbc php8.3-opcache php8.3-pgsql php8.3-pspell php8.3-readline php8.3-redis php8.3-snmp php8.3-soap php8.3-sqlite3 php8.3-tidy php8.3-uuid php8.3-xml php8.3-xsl php8.3-yaml php8.3-zip php8.3-zmq \
31+
php-mail && \
32+
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
33+
34+
# set php version as active
35+
RUN update-alternatives --set php "/usr/bin/php8.3"
36+
37+
# add www-data to sudoers
38+
COPY ./sudoers /etc/sudoers.d/www-data
39+
40+
# prepare www-data to be used as main user
41+
RUN usermod -s /bin/bash -G staff www-data && \
42+
mkdir -p /var/www /app && \
43+
touch /var/www/.bash_profile && \
44+
chown -R www-data. /var/www /app
45+
46+
# install composer
47+
RUN curl https://getcomposer.org/composer-1.phar > composer1 && \
48+
curl https://getcomposer.org/composer-2.phar > composer && \
49+
mv composer1 composer /usr/local/bin/ && \
50+
chown www-data:www-data /usr/local/bin/composer1 /usr/local/bin/composer && \
51+
chmod +x /usr/local/bin/composer1 /usr/local/bin/composer
52+
53+
# install yarn without nodejs
54+
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
55+
echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && \
56+
apt-get -y update && \
57+
apt-get install -y --no-install-recommends yarn && \
58+
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
59+
60+
# install nvm
61+
RUN sudo -i -u www-data sh -c 'curl -sL -o- "https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install.sh" | bash'
62+
63+
# this lets us make our build behave differently if needed
64+
ENV DOCKER="yes"
65+
66+
# prepare entrypoint and default command
67+
COPY ./entrypoint.sh /usr/local/bin/
68+
69+
WORKDIR /app/
70+
71+
USER www-data
72+
73+
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
74+
75+
CMD []

php8.3/entrypoint.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
# run the command
4+
args="$@"
5+
6+
if [ -z "${args}" ]
7+
then
8+
# empty cmd
9+
/bin/bash --login
10+
elif [[ ${args} =~ ^sh\ -c\ ]]
11+
then
12+
# most likely gitlab runnner
13+
/bin/bash --login
14+
else
15+
if [[ "$-" =~ i ]]
16+
then
17+
# interactive
18+
/bin/bash --login -i -c "${args}"
19+
else
20+
# non-interactive
21+
/bin/bash --login -c "${args}"
22+
fi
23+
fi

php8.3/sudoers

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
www-data ALL=(ALL) NOPASSWD:ALL

0 commit comments

Comments
 (0)