Ejemplo n.º 1
0
 /**
  * Deletes an image.
  */
 public function testDeleteImage()
 {
     $remote = new DockerRemoteRequest();
     // Delete the image.
     $this->assertNotEmpty($remote->Delete(['uri' => '/images/ubuntu:15.10', 'accept' => 'application/json']));
 }
Ejemplo n.º 2
0
 /**
  * Remove a container.
  */
 public function testRemoveContainer()
 {
     $remote = new DockerRemoteRequest();
     // Stop the container.
     $remote->Post(['uri' => '/containers/container_renamed/stop']);
     // Check the state.
     $inspect = $remote->Get(['uri' => '/containers/container_renamed/json', 'accept' => 'application/json']);
     $this->assertFalse($inspect->State->Running);
     // Remove the container.
     $remote->Delete(['uri' => '/containers/container_renamed?v=1']);
     // Check the state of the container, should return NULL, because
     // it cannot be found.
     $inspect = $remote->Get(['uri' => '/containers/container_renamed/json', 'accept' => 'application/json']);
     $this->assertNull($inspect);
 }