Python/PHP container with pre-commit installed.
1.3K
A Python container that includes pre-commit with PHP to allow for PHP related pre-commit hooks in continuous integration (CI) environments.
FROM --platform=amd64 python:3.11
# Install the required packages
RUN apt -qq update && apt -qq install -y lsb-release ca-certificates apt-transport-https software-properties-common gnupg2 &&\
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/sury-php.list &&\
wget -qO - https://packages.sury.org/php/apt.gpg | apt-key add - &&\
apt -qq update && apt -qq install -y php8.1 php8.1-cli git &&\
pip install pre-commit
# Specify the default working directory
WORKDIR /app
# Set the entrypoint to run by default
ENTRYPOINT ["pre-commit", "run", "--all-files"]
docker run --rm -v $(pwd):/app kchason/precommit-php:8.1
PreCommit:
stage: Lint
allow_failure: false
image:
name: kchason/precommit-php:8.1
entrypoint: [ "" ]
script:
- pre-commit run --all-files
tags:
- docker
Content type
Image
Digest
sha256:e3133f014…
Size
136.3 MB
Last updated
9 months ago
docker pull kchason/precommit-php