Skip to content

Instantly share code, notes, and snippets.

@jdecool
Created November 28, 2017 19:55
Show Gist options
  • Save jdecool/20fb5f030c365f527e2a0af7f4c74cfb to your computer and use it in GitHub Desktop.
Save jdecool/20fb5f030c365f527e2a0af7f4c74cfb to your computer and use it in GitHub Desktop.
Use sitespeed.io with docker-php
<?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