Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an example Dockerfile using Debian #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danakim
Copy link
Collaborator

@danakim danakim commented Dec 19, 2023

Hi @quartje ! When working on that ticket to remove gcc and other build tools from the images, we discussed the possibility of using plain Debian as a base for the php + apache images as well (like we do with the plain Apache2 images), as opposed to the official PHP image.

I have opened this branch and PR with an example Dockerfile in each of the php-apache images that uses Debian as a base. The files are called Dockerfile.debian. You will see that they are not as different as you would expect. The big difference is that Debian comes by default with PHP 7.4. We need PHP 7.2 and 8.2 The semi-official - and recommended by Debian - way to install various other versions of PHP is by using the Sury repository: https://deb.sury.org/. Adding this repo to the OS not only allows us to install various versions of PHP but also install them in parallel if we ever need to.

I have successfully used this repo in a lot of other projects, never ran into issues and especially security issues. I will leave it to you to evaluate if you want to use it. My recommendation would be to switch to this:

  • much easier to install and manage packages.
  • a consistent way of installing packages: no more using custom scripts and Pecl at the same time. And consistent with the other base images
  • no more build tools (gcc, gd) installed in the image
  • have tested this and resulting image is much smaller: ~350 mb as opposed to ~650 mb like it is now
  • you can install xdebug simply by running apt-get install php7.2-xdebug, no need to involve pecl in the mix

@danakim danakim requested a review from quartje December 19, 2023 10:32
@danakim
Copy link
Collaborator Author

danakim commented Dec 21, 2023

@quartje - I checked and you can actually install xdebug via that Sury repo. It is as simple as: apt-get install php7.2-xdebug (php8.2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant