Skip to content

Commit 7bcd514

Browse files
committed
PHP 8.5 RC
0 parents  commit 7bcd514

File tree

3 files changed

+103
-0
lines changed

3 files changed

+103
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
tags:
9+
- 'v*'
10+
pull_request:
11+
branches:
12+
- main
13+
- master
14+
workflow_dispatch:
15+
16+
env:
17+
REGISTRY: docker.io
18+
IMAGE_NAME: clegginabox/pipeline-php85
19+
20+
jobs:
21+
build-and-push:
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
25+
packages: write
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
34+
- name: Log in to Docker Hub
35+
if: github.event_name != 'pull_request'
36+
uses: docker/login-action@v3
37+
with:
38+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
39+
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
40+
41+
- name: Extract metadata (tags, labels) for Docker
42+
id: meta
43+
uses: docker/metadata-action@v5
44+
with:
45+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
46+
tags: |
47+
type=ref,event=branch
48+
type=ref,event=pr
49+
type=semver,pattern={{version}}
50+
type=semver,pattern={{major}}.{{minor}}
51+
type=semver,pattern={{major}}
52+
type=sha
53+
type=raw,value=latest,enable={{is_default_branch}}
54+
55+
- name: Build and push Docker image
56+
uses: docker/build-push-action@v5
57+
with:
58+
context: .
59+
push: ${{ github.event_name != 'pull_request' }}
60+
tags: ${{ steps.meta.outputs.tags }}
61+
labels: ${{ steps.meta.outputs.labels }}
62+
cache-from: type=gha
63+
cache-to: type=gha,mode=max

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea/

Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
FROM php:8.4-cli
2+
3+
# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
4+
ENV COMPOSER_ALLOW_SUPERUSER=1
5+
6+
# Install system dependencies
7+
RUN apt-get update && apt-get install -y \
8+
unzip \
9+
git \
10+
zip \
11+
curl \
12+
libzip-dev \
13+
libonig-dev \
14+
libxml2-dev \
15+
default-mysql-client \
16+
&& apt-get clean \
17+
&& rm -rf /var/lib/apt/lists/*
18+
19+
# Copy Composer from official image
20+
COPY --from=composer:2.8.9 /usr/bin/composer /usr/bin/composer
21+
22+
# Copy install-php-extensions from mlocati
23+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
24+
25+
# Install PHP extensions declaratively
26+
RUN install-php-extensions \
27+
mysqli \
28+
redis \
29+
pdo_mysql \
30+
pdo_pgsql \
31+
fileinfo \
32+
intl \
33+
sockets \
34+
bcmath \
35+
xsl \
36+
soap \
37+
zip \
38+
grpc \
39+
pcov

0 commit comments

Comments
 (0)