Skip to content

321zeno/docker-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build and test

Docker Helper

Utility classes for working with Docker,

Only docker ps is available currently. It can be used to create a page that displays the containers available on the host.

Example usage:

$dockerPs = new \DockerHelper\Commands\PsCommand;
// select nginx containers
$containers = $dockerPs->run()->filter(function($container) {
    return (preg_match('/nginx:/', $container->image));
})->getContainers();

Display the nginx containers

<?php foreach ($containers as $container) : ?>
    Name: <?= $container->getName(); ?>
    Id: <?= $container->getId(); ?>
    HTTP: <?= $container->getHostPortByContainerPort(80); ?>
    HTTPS: <?= $container->getHostPortByContainerPort(443); ?>
<?php endforeach; ?>

About

PHP wrapper for Docker commands

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages