Dockerfile icon indicating copy to clipboard operation
Dockerfile copied to clipboard

Update: Git version that meets the requirements of composer

Open prodigy7 opened this issue 3 years ago • 2 comments
trafficstars

I use the NGinx PHP images and extend with a Dockerfile around my own requirements. As part of a GitLab pipeline, I then run the PHP diagnostics command over it. In the process, I noticed that the current version of Composer criticises the PHP 8.0 and 8.1 image because the Git version is too old:

Checking platform settings: OK
Checking git settings: WARNING
Your git version (2.20.1) is too old and possibly will cause issues. Please upgrade to git 2.24 or above
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys: 
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE[50](https://gitlab.entwicklung.mensch-und-mouse.de/mum-software-library/docker-images-php/-/jobs/7162#L50)952
OK
Checking composer version: OK
Composer version: 2.4.4
PHP version: 8.1.12
PHP binary path: /usr/local/bin/php
OpenSSL version: OpenSSL 1.1.1n  15 Mar 2022
cURL version: 7.[64](https://gitlab.entwicklung.mensch-und-mouse.de/mum-software-library/docker-images-php/-/jobs/7162#L64).0 libz 1.2.11 ssl OpenSSL/1.1.1n
zip: extension present, unzip present, 7-Zip not available

Is there any planning to raise Git to a version that is comfortable for Composer?

I can of course also raise the version via my Dockerfile, but maybe it would make more sense to update the version in general?

prodigy7 avatar Nov 11 '22 17:11 prodigy7

We use git from the standard debian repositories. Atm I don't have time to maintain the images properly therefore it's unlikely that I'll include git from another package maintainer any time soon.

htuscher avatar Nov 14 '22 08:11 htuscher

I managed to install a newer version of Git using backports, as explained in the Unix & Linux Stack Exchange. This is my complete Dockerfile:

FROM webdevops/php-apache-dev:8.1

# The container OS is Debian GNU/Linux 10 (buster) and it runs Git 2.20.1 as its
# latest stable version. We install Git 2.30.2 through backporting, which
# installs new package releases on older OS releases.
# https://unix.stackexchange.com/a/112160/405871
# https://stackoverflow.com/a/54277540/3130281
RUN echo 'deb http://deb.debian.org/debian buster-backports main' > /etc/apt/sources.list.d/backports.list
RUN apt-get update -y
RUN apt-get install -y -t buster-backports git

hdodov avatar Feb 04 '24 07:02 hdodov