WyriHaximusNet / docker-php

Opinionated PHP Docker images
https://hub.docker.com/r/wyrihaximusnet/php
MIT License
39 stars 6 forks source link

FPM tags #210

Open frankvanhest opened 1 year ago

frankvanhest commented 1 year ago

Hi @WyriHaximus,

In the documentation fpm is mentioned, but in the tags I can't seem to find a tag for fpm on docker hub. Hopefully, you can help me further.

Cheers,

Frank

WyriHaximus commented 1 year ago

Hey @frankvanhest I'll update the docs to remove that, this repo isn't building FPM images. But it is probably a leftover from when I based this repo on https://github.com/usabilla/php-docker-template

frankvanhest commented 1 year ago

Thanks for your quick response! I'll try to install it manually in the container. I love the builds you provide, fpm was the only thing missing.

WyriHaximus commented 1 year ago

The main goal of these images are for running ReactPHP from the CLI, what are you looking for in them for FPM?

frankvanhest commented 1 year ago

I know they are build for ReactPHP and that is something you don't really use in FPM. I don't intend to use it in FPM. Your images are complete with all the most common PHP extensions, composer included, Xdebug included, and so on. I was hoping that FPM was included, so I can use one Docker hub for everything PHP related in my projects. Thats the main reason for me

WyriHaximus commented 1 year ago

Let's get started that I'm not opposed to adding FPM images. Might have rejected it in the past but IMHO it could serve for micro ReactPHP apps during FPM requests as well.

Would you be interested in picking this task up? There is some work that would needs to be done from Docker files to tests to dealing with odd exceptions.

frankvanhest commented 1 year ago

Yeah sure, I can give it a try! It can give me a better understanding on how to build docker images and ReactPHP. I can get started on it this Friday night.

WyriHaximus commented 1 year ago

Awesome! Just ping me when you have questions or run into any thing

frankvanhest commented 1 year ago

@WyriHaximus, well I'm a bit stuck with adding FPM. I created the Docker files for Alpine an Debian. Running the makefile gives some error due to missing environment variables such as GITHUB_OUTPUT used in https://github.com/WyriHaximus/github-action-supported-php-versions/blob/master/versions.php

Do you have the time to help get underway?

This is what I have so far https://github.com/frankvanhest/docker-php/tree/add_fpm. When running build-php.sh fpm fpm 8.1 8.1 alpine alpine3.16 alpine3.16 alpine3.11 arm64 it stops at:

 => [build-uv 1/3] RUN git clone https://github.com/amphp/ext-uv uv                                                                                                                                                 2.2s
 => [build-uv 2/3] WORKDIR /uv                                                                                                                                                                                      0.0s
 => ERROR [build-uv 3/3] RUN git fetch     && git pull     && phpize     && ./configure     && make install     && EXTENSION_DIR=`php-config --extension-dir 2>/dev/null`     && cp "$EXTENSION_DIR/uv.so" /uv.so   0.2s
------
 > [build-uv 3/3] RUN git fetch     && git pull     && phpize     && ./configure     && make install     && EXTENSION_DIR=`php-config --extension-dir 2>/dev/null`     && cp "$EXTENSION_DIR/uv.so" /uv.so     && sha256sum /uv.so:
#14 0.149 fatal: not a git repository (or any of the parent directories): .git
------
executor failed running [/bin/sh -c git fetch     && git pull     && phpize     && ./configure     && make install     && EXTENSION_DIR=`php-config --extension-dir 2>/dev/null`     && cp "$EXTENSION_DIR/uv.so" /uv.so     && sha256sum /uv.so]: exit code: 128

I don't see why the error fatal: not a git repository (or any of the parent directories): .git is given. Perhaps you can shed a light on it.

WyriHaximus commented 1 year ago

@frankvanhest Haven't ran into that one before. Will have a look tomorrow morning at you branch and see if I have the same issue

WyriHaximus commented 1 year ago

@frankvanhest Looks like / isn't the default path you enter the container in for FPM. So change line 25 to:

RUN git clone https://github.com/amphp/ext-uv uv
frankvanhest commented 1 year ago

@WyriHaximus Thanks for your help! The work directory was indeed incorrect. I The line you mentioned was already correct. After I changed line 26 to

WORKDIR uv

I could successfully build the image.

Screenshot 2022-11-26 at 14 19 03

Is there a way to run the make build command locally? It looks like depends on GitHub actions and their environment. Where does the file docker-image/image.tags gets created? By looking a the code, I cannot seem to find it.

WyriHaximus commented 1 year ago

So everything is currently in a state of transition to a better solution for both local and GHA building. And while most of it is working on GHA, the same scripts can be used for the Makefile, but it needs some work. Will have a look at it after dinner.

Planning a few steps a head here, but can you file a PR like this one https://github.com/WyriHaximusNet/docker-php/pull/209 but for RC7? This way once you file the PR for the FPM tags you don't need to wait for my approval to run the workflow :)

frankvanhest commented 1 year ago

Thanks! I've created one for RC7 https://github.com/WyriHaximusNet/docker-php/pull/211. Tomorrow evening I'll continue working on this. Apparently first timers need approval ;)

Screenshot 2022-11-28 at 19 49 02
WyriHaximus commented 1 year ago

I think you PR'ed the wrong changes ;). They introduced that when cryptocurrency fanatics where filing PR's to run miners in GHA 🤐 . And it marks you as cool after the first merged PR 😅