-
Notifications
You must be signed in to change notification settings - Fork 1
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
Building the extension in Docker #3
Comments
This is due to an issue with the configured remote in one of the testbed repositories. I will have to fix this in the next release. For now, I have a workaround that I've added to your Dockerfile: ARG PHP_VERSION_MAJOR=8
ARG PHP_VERSION_MINOR=1
ARG PHP_VERSION=$PHP_VERSION_MAJOR.$PHP_VERSION_MINOR
FROM php:$PHP_VERSION-zts-bookworm as php-git2-debian
ARG PHP_VERSION_MAJOR
ARG PHP_VERSION_MINOR
ARG PHP_VERSION
ARG PHP_GIT2_PHP_VERSION=php$PHP_VERSION_MAJOR
ARG PHP_GIT2_VERSION=v2.0.0
RUN apt-get update && \
apt-get -y --no-install-recommends install \
git \
wget \
libgit2-dev \
unzip \
&& \
apt-get clean
RUN cd /opt && \
wget https://github.com/RogerGee/php-git2/archive/refs/tags/$PHP_GIT2_PHP_VERSION/$PHP_GIT2_VERSION.zip -O php-git2.zip && \
unzip php-git2.zip && \
cd /opt/php-git2-$PHP_GIT2_PHP_VERSION-$PHP_GIT2_VERSION && \
phpize && \
./configure && \
make && \
make install && \
rm /opt/php-git2.zip
RUN docker-php-ext-enable git2
FROM php-git2-debian as php-git2-debian-test
ARG PHP_VERSION_MAJOR
ARG PHP_VERSION_MINOR
ARG PHP_VERSION
ARG PHP_GIT2_PHP_VERSION=php$PHP_VERSION_MAJOR
ARG PHP_GIT2_VERSION=v2.0.0
COPY --from=composer/composer:2-bin /composer /usr/bin/composer
RUN git config --global user.name root && \
git config --global user.email root@localhost
# This fixes an issue with running the testbed concerning the remote configured
# in the bare repository. We need it to point at an actual repository on disk.
# This will be fixed in future releases of php-git2. -RogerGee
RUN cd /opt/php-git2-$PHP_GIT2_PHP_VERSION-$PHP_GIT2_VERSION/testbed/repos && \
git init general && \
cd general && \
echo 'contents' > file && \
git add file && \
git commit -m '1' && \
cd ../general.git && \
git remote set-url origin /opt/php-git2-$PHP_GIT2_PHP_VERSION-$PHP_GIT2_VERSION/testbed/repos/general
RUN cd /opt/php-git2-$PHP_GIT2_PHP_VERSION-$PHP_GIT2_VERSION/testbed && \
echo composer update && \
composer install && \
php main.php I had to modify the file slightly to get it to build for me. (I may be running an older version of Docker.) Also, I removed the I will close this issue out once those changes are in place. Sorry for any inconvenience. |
Thanks for your fix. |
Hello,
Here is a Dockerfile i'm trying to create to compile and test this extension with multiple PHP versions.
I run the testbed at the end to verify that the extension is working.
The tests are failing on PHP 8.1 and 8.2 with the following errors :
The text was updated successfully, but these errors were encountered: