Skip to content

Commit fdc5fe8

Browse files
switch to Debian vs Fedora
1 parent 7f78680 commit fdc5fe8

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

Dockerfile

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
ARG fedora_version
2-
FROM fedora:${fedora_version}
1+
ARG debian_version
2+
FROM debian:${debian_version}
33

44
ARG userid=3000
55
ARG groupid=3000
@@ -34,16 +34,15 @@ ENV PHP_OPCACHE_MAX_WASTED_PERCENTAGE=$PHP_OPCACHE_MAX_WASTED_PERCENTAGE_ARG
3434
ENV PHP_OPCACHE_INTERNED_STRINGS_BUFFER=$PHP_OPCACHE_INTERNED_STRINGS_BUFFER_ARG
3535
ENV PHP_OPCACHE_FAST_SHUTDOWN=$PHP_OPCACHE_FAST_SHUTDOWN_ARG
3636

37-
# speed up dnf (https://ostechnix.com/how-to-speed-up-dnf-package-manager-in-fedora/)
38-
RUN echo 'max_parallel_downloads=10' >> /etc/dnf/dnf.conf
39-
4037
# add the application user
4138
RUN groupadd -r -g ${groupid} appgroup \
4239
&& useradd --no-create-home --no-log-init --system --home-dir=/app --uid ${userid} --gid ${groupid} appuser
4340

4441
RUN mkdir -p /app && chown -R appuser:appgroup /app
4542

46-
RUN dnf --disablerepo=fedora-cisco-openh264 install -y \
43+
RUN export DEBIAN_FRONTEND=noninteractive \
44+
&& apt update -y \
45+
&& apt install -y \
4746
curl \
4847
unzip \
4948
nginx \
@@ -64,8 +63,9 @@ RUN dnf --disablerepo=fedora-cisco-openh264 install -y \
6463
php-soap \
6564
php-xml \
6665
php-zip \
67-
&& dnf --disablerepo=fedora-cisco-openh264 update -y \
68-
&& dnf --disablerepo=fedora-cisco-openh264 clean all -y
66+
&& apt upgrade -y \
67+
&& apt autoremove -y \
68+
&& apt clean -y
6969

7070
# copy the files from the host to the container that we need
7171
COPY etc/supervisord.conf /etc/supervisord.conf

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
IMAGE ?= craftcms/image
22
PHP_VERSION ?= 8.2
3-
FEDORA_VERSION ?= 39
3+
DEBIAN_VERSION ?= 12
44

55
build:
66
docker build \
77
--build-arg php_version=${PHP_VERSION} \
8-
--build-arg fedora_version=${FEDORA_VERSION} \
8+
--build-arg debian_version=${DEBIAN_VERSION} \
99
--no-cache \
1010
--progress plain \
1111
--tag ${IMAGE}:${PHP_VERSION} .

README.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ In this example, we’re setting the PHP memory limit to `512M` rather than the
4343
version: "3.6"
4444
services:
4545
php-fpm:
46-
image: ghcr.io/craftcms/image:8.1
46+
image: ghcr.io/craftcms/image:8.2
4747
volumes:
4848
- .:/app
4949
env_file: .env
@@ -70,16 +70,14 @@ services:
7070
| `opcache.interned_strings_buffer` | `PHP_OPCACHE_INTERNED_STRINGS_BUFFER` | `16` |
7171
| `opcache.fast_shutdown` | `PHP_OPCACHE_FAST_SHUTDOWN` | `1` |
7272

73-
## Upgrading Fedora
73+
## Upgrading Debian
7474

75-
In order to update Fedora (e.g. Fedora 38 was released), follow these steps:
75+
In order to update Debian (e.g.Debian 13 was released), follow these steps:
7676

77-
1. Update the `FEDORA_VERSION` in the `Makefile` to the new version (e.g. `FEDORA_VERSION=38`). This will update the
77+
1. Update the `DEBIAN_VERSION` in the `Makefile` to the new version (e.g. `DEBIAN_VERSION=13`). This will update the
7878
base image used for the build.
7979
2. Update the `PHP_VERSION` in the `Makefile` to the new version (e.g. `PHP_VERSION=8.2`). This will update the
8080
PHP version installed in the image.
8181
3. Then, run `make build` to rebuild the image to test locally.
8282

83-
> Note: The version of Fedora determines the version of PHP that is installed. For example, Fedora 38 uses PHP 8.2 and Fedora 37 uses 8.1.
84-
85-
83+
> Note: The version of Debian determines the version of PHP that is installed. For example, Debian 12 uses PHP 8.2.

examples/craftcms/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ USER root
55

66
# copy the files from the host to the container that we need
77
COPY etc/nginx/nginx.conf /etc/nginx/nginx.conf
8-
COPY etc/supervisord.d/nginx.ini /etc/supervisord.d/nginx.ini
8+
#COPY etc/supervisord.d/nginx.ini /etc/supervisord.d/nginx.ini
99

1010
# set the sockets and pid files to be writable by the appuser
1111
RUN mkdir -p /var/log/nginx && chown -R appuser:appgroup /var/log/nginx

0 commit comments

Comments
 (0)