Sign inSign up

mgldvd/alpine-php85

By mgldvd

โ€ขUpdated 1 day ago

Alpine PHP 8.5 image with Bash tooling

Image
0

3.4K

mgldvd/alpine-php85 repository overview

Mgldvd-Docker

โ Alpine PHP 8.5 Docker Image

Docker + PHP 8.5

This repo builds the mgldvd/alpine-php85 Docker image on top of alpine:latest, adding Bash tooling and PHP 8.5.

โš ๏ธ Warning: The GitHub Action rebuilds and republishes the image every Sunday to keep it up to date with the latest PHP 8.5 version.

โ ๐Ÿงญ Overview

demo

Single Dockerfile using Alpine + Vim, published by the GitHub Actions workflow on deploy/hub.

โ ๐Ÿ“ฆ Packages installed via apk add
  • bash
  • sudo
  • curl
  • neovim
  • coreutils
  • php85
  • php85-cli
  • php85-fpm
  • php85-mbstring
  • php85-curl
  • php85-zip
  • php85-xml
  • php85-dom
  • php85-pdo
  • php85-pdo_mysql

โ ๐Ÿท๏ธ Image Tags

TagDescription
latestMost recent successful build on deploy/hub

โ โ˜๏ธ Docker hub

โ ๐Ÿงช PHP 8.5 Example
docker run --rm -it -v "$PWD:/app" mgldvd/alpine-php85 bash
# inside the container shell
echo "<?php echo 'hello from alpine-php85'.PHP_EOL;" > hello.php

php ./hello.php
โ ๐Ÿงช PHP 8.5 Example Pipeline
<?php
$result = "  hello world  from alpine-php85 "
    |> trim(...)
    |> strtoupper(...);

echo $result; // "HELLO WORLD  FROM ALPINE-PHP85"
  • Requires the PHP 8.5 pipeline operator |>

โ ๐Ÿ› ๏ธ Building Locally

Clone the project and build the image using the provided Dockerfile:

git clone https://github.com/Mgldvd-Docker/alpine-php85.git

cd alpine-php85
docker build -t mgldvd/alpine-php85:local .

Run the container to verify the build:

docker run --rm -it -v "$PWD:/app" mgldvd/alpine-php85:local bash
โ ๐Ÿณ Docker Compose

Use the bundled compose.ymlโ  to launch an interactive shell with your local app/ directory mounted into the container:

mkdir app
wget https://raw.githubusercontent.com/Mgldvd-Docker/alpine-php85/refs/heads/master/compose.yml

or create file: compose.yml

services:
    app:
        image: mgldvd/alpine-php85
        command: bash
        volumes:
            - ./app:/app
        stdin_open: true
        tty: true
        restart: "no"
docker compose run --rm app

To keep the container running in the background instead, start it detached and exec into it when needed:

docker compose up -d
docker compose exec app bash


โ ๐Ÿš€ Publishing Workflow

The GitHub Actions workflow at .github/workflows/docker-publish.yml automates image publication. It performs the following steps:

  1. Checks out the repository.
  2. Prepares Docker Buildx for multi-platform builds.
  3. Authenticates against Docker Hub using repository secrets.
  4. Generates OCI metadata, including links back to GitHub and Docker Hub.
  5. Builds the image and pushes the multi-arch latest tag.
โ ๐Ÿ” Required Secrets

Add the following secrets in the GitHub repository settings before running the workflow:

  • DOCKERHUB_USERNAME: Docker Hub account name (e.g., mgldvd).
  • DOCKERHUB_TOKEN: Docker Hub access token with permission to push the repository.
โ โ–ถ๏ธ Triggering a Publish

Push commits to the deploy/hub branch or run the workflow manually from the GitHub Actions tab to build and publish a new image version.

โ ๐Ÿค Contributing

Issues and pull requests are welcome. Please open a discussion in the GitHub repository if you plan substantial changes so proposals can be coordinated with the publishing workflow.

Tag summary

Content type

Image

Digest

sha256:bf5c4efb1โ€ฆ

Size

25.4 MB

Last updated

1 day ago

docker pull mgldvd/alpine-php85