Skip to content

Commit 9ffae5c

Browse files
committed
Updated base image to ubuntu:22.04 and added PHP 8.2
1 parent fdc0d6c commit 9ffae5c

File tree

14 files changed

+145
-10
lines changed

14 files changed

+145
-10
lines changed

Dockerfile.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:22.04
22

33
MAINTAINER Tin Benjamin Matuka <[email protected]>
44

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"
3+
PHP_VERSIONS="5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2"
44

55
for PHP_VERSION in $PHP_VERSIONS;
66
do

packages-php8.2.txt

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

php5.6/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:22.04
22

33
MAINTAINER Tin Benjamin Matuka <[email protected]>
44

php7.0/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:22.04
22

33
MAINTAINER Tin Benjamin Matuka <[email protected]>
44

php7.1/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:22.04
22

33
MAINTAINER Tin Benjamin Matuka <[email protected]>
44

php7.2/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:22.04
22

33
MAINTAINER Tin Benjamin Matuka <[email protected]>
44

php7.3/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:22.04
22

33
MAINTAINER Tin Benjamin Matuka <[email protected]>
44

php7.4/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:22.04
22

33
MAINTAINER Tin Benjamin Matuka <[email protected]>
44

php8.0/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:22.04
22

33
MAINTAINER Tin Benjamin Matuka <[email protected]>
44

php8.1/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:22.04
22

33
MAINTAINER Tin Benjamin Matuka <[email protected]>
44

php8.2/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.2 php8.2-amqp php8.2-apcu php8.2-bcmath php8.2-bz2 php8.2-cgi php8.2-cli php8.2-common php8.2-curl php8.2-dev php8.2-gd php8.2-gmp php8.2-imagick php8.2-imap php8.2-intl php8.2-ldap php8.2-mailparse php8.2-mbstring php8.2-memcached php8.2-mysql php8.2-odbc php8.2-opcache php8.2-pgsql php8.2-pspell php8.2-readline php8.2-redis php8.2-snmp php8.2-soap php8.2-sqlite3 php8.2-tidy php8.2-uuid php8.2-xml php8.2-xsl php8.2-yaml php8.2-zip php8.2-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.2"
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.2/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.2/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)