2017 © Pedro Peláez
 

composer-plugin docker_plugin

This is plugin for building docker images with composer

image

bukharovsi/docker_plugin

This is plugin for building docker images with composer

  • Thursday, May 11, 2017
  • by Bukharovsi
  • Repository
  • 2 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 10 Versions
  • 0 % Grown

The README.md

PHP Docker plugin

Build Status Codacy Badge Dependency Status, (*1)

PHP Docker plugin is a plugin for composer that helps build and push docker images. It is very useful for continuous integration. This plugin allow you to define image name, compute tags and generate reports., (*2)

When you use this plugin you still need Dockerfile. The plugin only simplified automation build!, (*3)

Basic usage

If you already have Dockerfile and can build image manually just install plugin and build image immediately and push it to docker registry, (*4)

php composer.phar require bukharovsi/docker_plugin
php composer.phar docker:build
php composer.phar docker:push

You will get docker image with tag: :, (*5)

Advanced usage

How to change project defaults?

Defaults can be changed in composer.json and with console arguments, (*6)

Change project defaults in composer.json

define in composer.json extra section:, (*7)

"extra": {
    "docker": {
          "name": "wine_the_pooh.com/honey",
          "version": "1.0",
          "dockerfile": "Dockerfile",
          "workingdirectory": "."
    }
}

all definitions are optional, (*8)

Change project defaults with console arguments

all arguments are optional, (*9)

php composer.phar docker:build --name wine_the_pooh.com --tag latest --dockerfile Dockerfile --workingdirectory /var/www/wine_the_pooh

Getting image version from git

If you are using Git for version control or git flow you can generate image tag based on current Git branch or Git tag. For using this feature specify "version":"@vcs" in composer.json or add --tag @vcs to composer docker:build and composer docker:push command How does Git tag transforms to Docker tag?, (*10)

Git branch Docker tag
master latest, (*if commit has a git tag then it add docker tag that will be equals current git tag)
dev, develop, development dev
any_other_branch any_other_branch, Commit SHA

Integration with Teamcity

Docker plugin can notify Teamcity about built image versions. This plugin use teamcity environment variables - env.BuildTag - env.BuildTag.1 - env.BuildTag.2 - ... - env.BuildTag.n, (*11)

after running composer docker:build you can use %env.BuildTag% and other variables in your scripts, (*12)

The Versions

11/05 2017
09/02 2017

dev-oop_refactoring

dev-oop_refactoring

This is plugin for building docker images with composer

  Sources   Download

Apache 2.0

The Requires

 

The Development Requires

by Sergey Bukharov

26/01 2017

dev-create_commands

dev-create_commands

This is plugin for building docker images with composer

  Sources   Download

proprietary

The Requires

  • composer-plugin-api ^1.1

 

by Sergey Bukharov

26/01 2017

v1.0.2

1.0.2.0

This is plugin for building docker images with composer

  Sources   Download

proprietary

The Requires

  • composer-plugin-api ^1.1

 

by Sergey Bukharov

26/01 2017

v1.0.1

1.0.1.0

This is plugin for building docker images with composer

  Sources   Download

proprietary

The Requires

  • composer-plugin-api ^1.1

 

by Sergey Bukharov

16/01 2017

v1.0

1.0.0.0

This is plugin for building docker images with composer

  Sources   Download

proprietary

The Requires

  • composer-plugin-api ^1.1

 

by Sergey Bukharov