2023-10-03 09:57:30 +07:00
2023-10-03 09:54:43 +07:00
2023-10-03 09:54:43 +07:00
2023-10-03 09:54:43 +07:00
2023-10-03 09:54:43 +07:00
2023-10-03 09:54:43 +07:00
2023-10-03 09:54:43 +07:00
2022-12-14 13:07:13 +07:00
2023-10-03 09:57:30 +07:00

Docker images with php and composer inside

continuous integration

Images can be found on docker hub

Supported versions

  • php 8.2.11
    • composer 2.6.4
    • xdebug 3.2.2
  • php 8.1.24
    • composer 2.6.4
    • xdebug 3.2.2
  • php 8.0.30
    • composer 2.6.4
    • xdebug 3.2.2
  • php 7.4.33 (latest)
    • composer 2.6.4
    • xdebug 2.9.8
    • rdkafka 6.0.3
    • timecop 1.2.10
  • php 7.3.33
    • composer 2.6.4
    • xdebug 2.9.8
    • rdkafka 6.0.3
    • timecop 1.2.10
  • php 7.2.34
    • composer 2.6.4
    • xdebug 2.7.2
    • rdkafka 6.0.3
    • timecop 1.2.10

All images now include zsh, that allowed using oh-my-zsh and its plugins for improving user experience.

Build

To build container just use one of these commands:

make build-72
make build-73
make build-74
make build-80
make build-81

Run

After making image run

docker run -it --rm -v `pwd`:/var/www/project -w /var/www/project --user=1000 php-for-dev:M.m sh

where replace M with major, and m with minor php version.

Using oh-my-zsh from local machine

To use already installed oh-my-zsh inside docker container we should pass couple volumes and environment variables:

  • -v .zshrc:/home/user/.zshrc - configuration file for zsh
  • -v .oh-my-zsh:/home/user/oh-my-zsh - directory with installed oh-my-zsh
  • -e HOME=/home/user - define user home directory

Full run command would be looks like

docker run -it --rm \
    -v `pwd`:/var/www/project \
    -v .zshrc:/home/user/.zshrc \
    -v .oh-my-zsh:/home/user/oh-my-zsh \
    -e HOME=/home/user \
    -w /var/www/project \
    --user=1000 php-for-dev:M.m sh
Description
Dockerized php-cli for simplified usage for local development
Readme 254 KiB
Languages
Dockerfile 90.3%
Makefile 9.7%