Created
November 28, 2017 19:55
-
-
Save jdecool/20fb5f030c365f527e2a0af7f4c74cfb to your computer and use it in GitHub Desktop.
Use sitespeed.io with docker-php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$docker = new Docker(); | |
$containerManager = $docker->getContainerManager(); | |
$containerConfig = new ContainerConfig(); | |
$containerConfig->setImage('sitespeedio/sitespeed.io'); | |
$containerConfig->setCmd(['https://www.website.com', '-b', 'firefox', '--speedIndex', '--video']); | |
$hostConfig = new HostConfig(); | |
$hostConfig->setBinds(['/tmp/sitespeed:/sitespeed.io']); | |
$containerConfig->setHostConfig($hostConfig); | |
$containerCreateResult = $containerManager->create($containerConfig); | |
$containerManager->start($containerCreateResult->getId()); | |
$containerManager->wait($containerCreateResult->getId()); | |
$containerManager->remove($containerCreateResult->getId()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment