2017 © Pedro Peláez
 

library dockerfile

Dockerfile generator

image

smalot/dockerfile

Dockerfile generator

  • Monday, November 24, 2014
  • by smalot
  • Repository
  • 1 Watchers
  • 2 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Dockerfile Generator

This library will help you to generate a Dockerfile programmatically., (*1)

include 'vendor/autoload.php';

use \Smalot\Docker\Dockerfile\Dockerfile;
use \Smalot\Docker\Dockerfile\Instruction\Run;
use \Smalot\Docker\Dockerfile\Instruction\Expose;
use \Smalot\Docker\Dockerfile\Source\File;

$dockerFile = new Dockerfile('debian:wheezy', 'Sebastien MALOT <smalot@actualys.com>');

$cmds = array(
    'apt-get update',
    'DEBIAN_FRONTEND=noninteractive apt-get -y upgrade',
    'DEBIAN_FRONTEND=noninteractive apt-get -y install supervisor pwgen',
    'DEBIAN_FRONTEND=noninteractive apt-get -y install git apache2 libapache2-mod-php5 php5-mysql php5-pgsql php5-gd php-pear php-apc curl',
    'curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin',
    'mv /usr/local/bin/composer.phar /usr/local/bin/composer',
);

$layer = new Run($cmds, 'Install packages');
$dockerFile->addLayer($layer);

$layer = new Expose(array(80, 443), 'Expose Ports');
$dockerFile->addLayer($layer);

$writer = new File('Dockerfile');
$dockerFile->write($writer);

Notes

Excluding FROM and MAINTAINER instructions, which are passed to the constructor, other ones are passed to the writer in the same order as added to the Dockerfile object., (*2)

The Versions

24/11 2014

v0.3

0.3.0.0

Dockerfile generator

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

generator docker dockerfile

24/11 2014

dev-master

9999999-dev

Dockerfile generator

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

generator docker dockerfile

24/11 2014

v0.2

0.2.0.0

Dockerfile generator

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

generator docker dockerfile

23/11 2014

v0.1

0.1.0.0

Dockerfile builder

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

generator docker builder dockerfile