Php library for managing docker and its commands.
composer require simondevelop/php-docker
<?php
// Initiate
require "vendor/autoload.php";
use SimonDevelop\Docker;
$docker = new Docker("mysql:5.7", [
"3306" => "3306"
], [
"/my/own/datadir" => "/var/lib/mysql"
]);
$docker->setEnv([
"MYSQL_ROOT_PASSWORD" => "my-secret-pw"
]);
echo $docker->run();
// docker run -d -v /my/own/datadir:/var/lib/mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw mysql:5.7
Check this docs for more.
- Check the Code of Conduct
- Check the Contributing file
- Check the Pull Request Template