PHPackages                             ronmi/dockerkit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. ronmi/dockerkit

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

ronmi/dockerkit
===============

0.1.7(10y ago)493PHP

Since Nov 26Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Ronmi/dockerkit)[ Packagist](https://packagist.org/packages/ronmi/dockerkit)[ RSS](/packages/ronmi-dockerkit/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (6)Versions (11)Used By (0)

DockerKit
=========

[](#dockerkit)

DockerKit is NOT part of Fruit Framework.

DockerKit is a set of tools helping you manage docker container/image from php.

DockerKit supports only bash as default shell, using other shell like zsh is not supported.

Synopsis
--------

[](#synopsis)

Write your dockerfile generator:

```
$f = new Fruit\DockerKit\Dockerfile('debian:latest', 'John Doe ');

$f
    ->distro('debian')
    ->install(['php5-fpm', 'php5'])
    ->ensureBash()
    ->grouping(true)
    ->textfileArray([
        '#!/bin/bash',
        'service php5-fpm restart',
        'trap "echo Stopping fpm...;service php5-fpm stop" INT TERM',
        '(kill -STOP $BASHPID)&',
        'wait',
    ], '/start.sh')
    ->chmod('a+x', '/start.sh')
    ->grouping(false)
    ->entrypoint(['bash', '/start.sh']);

echo $f->generate();
```

which generates

```
FROM debian:latest
MAINTAINER John Doe
RUN apt-get update \
 && apt-get install -y php5-fpm php5 \
 && apt-get clean \
 && echo 'dash dash/sh boolean false'|debconf-set-selections \
 && DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash \
 && echo '#!/bin/bash'|tee /start.sh \
 && echo 'service php5-fpm restart'|tee -a /start.sh \
 && echo 'trap "echo Stopping fpm...;service php5-fpm stop" INT TERM'|tee -a /start.sh \
 && echo '(kill -STOP $BASHPID)&'|tee -a /start.sh \
 && echo 'wait'|tee -a /start.sh \
 && chmod a+x /start.sh
ENTRYPOINT ["bash","/start.sh"]

```

So you can pipe it to `docker build` like `php my_generator.php|docker build -t my_tag -`, or

```
(new Fruit\DockerKit\DockerBuild('my_tag')->run($f);
```

### Grouping

[](#grouping)

Grouping can merge shell commands into one `RUN` command, reduce intermediate layers needed when building image.

### Installers

[](#installers)

You can write custom installers to share same application/library between different dockerfile generators. See `src/ServiceStarter.php`, which helps you generate shell script to manage service start/stop, as example.

```
$f = new Fruit\DockerKit\Dockerfile('debian:latest', 'John Doe ');
$f->distro('debian')->install(['nginx', 'php5-fpm']);

(new Fruit\DockerKit\ServiceStarter('/entry.sh'))
    ->starters([
        'service php5-fpm start',
        'service nginx start',
    ])
    ->stopers([
        'service php5-fpm stop',
        'service nginx stop',
    ])
    ->installTo($f);

echo $f->entrypoint('/entry.sh')->generate();
```

will generates

```
FROM debian:latest
MAINTAINER John Doe
RUN apt-get update \
 && apt-get install -y nginx php5-fpm \
 && apt-get clean \
 && echo '#!/bin/bash'|tee /entry.sh \
 && echo 'function start() {'|tee -a /entry.sh \
 && echo '  service php5-fpm start'|tee -a /entry.sh \
 && echo '  service nginx start'|tee -a /entry.sh \
 && echo '}'|tee -a /entry.sh \
 && echo ''|tee -a /entry.sh \
 && echo 'function stop() {'|tee -a /entry.sh \
 && echo '  service php5-fpm stop'|tee -a /entry.sh \
 && echo '  service nginx stop'|tee -a /entry.sh \
 && echo '}'|tee -a /entry.sh \
 && echo 'trap stop INT TERM'|tee -a /entry.sh \
 && echo ''|tee -a /entry.sh \
 && echo '(kill -SIGSTOP $BASHPID)&'|tee -a /entry.sh \
 && echo 'wait'|tee -a /entry.sh \
 && chmod a+x /entry.sh
ENTRYPOINT /entry.sh

```

### Supported distros

[](#supported-distros)

Currently we support only Debian. PR is welcome. See `src/Distro/Distro.php` about how to implement.

### More examples

[](#more-examples)

You can find more examples in test cases, especially commands not documented here.

License
-------

[](#license)

You can choose any of GPL, LGPL or MIT license.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~12 days

Recently: every ~23 days

Total

9

Last Release

3724d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ef743a4ba2b41bc6643ca3c4d71f4608abee7dc617efa09b18e3fa0a44aeda8?d=identicon)[Ronmi](/maintainers/Ronmi)

---

Top Contributors

[![Ronmi](https://avatars.githubusercontent.com/u/59556?v=4)](https://github.com/Ronmi "Ronmi (54 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/ronmi-dockerkit/health.svg)

```
[![Health](https://phpackages.com/badges/ronmi-dockerkit/health.svg)](https://phpackages.com/packages/ronmi-dockerkit)
```

###  Alternatives

[deployer/deployer

Deployment Tool

11.0k25.4M207](/packages/deployer-deployer)[appwrite/server-ce

End to end backend server for frontend and mobile apps.

55.3k84.2k](/packages/appwrite-server-ce)[pragmarx/health

Laravel Server &amp; App Health Monitor and Notifier

2.0k1.0M2](/packages/pragmarx-health)[felixfbecker/language-server-protocol

PHP classes for the Language Server Protocol

22476.7M6](/packages/felixfbecker-language-server-protocol)[heroku/heroku-buildpack-php

Toolkit for starting a PHP application locally, with or without foreman, using the same config for PHP and Apache2/Nginx as on Heroku

8161.3M10](/packages/heroku-heroku-buildpack-php)[tiamo/phpas2

PHPAS2 is a php-based implementation of the EDIINT AS2 standard

4674.7k](/packages/tiamo-phpas2)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
