private void logout() throws IOException, InterruptedException {
    if (username != null && password != null) {
      new Command("docker", "logout", dockerHost + ":" + port).run();
    }
  }
Pulls an image and pushes it to the local registry under a new tag.

@param from the image reference to pull
@param to the new location of the image (i.e. {@code localhost:[port]/[to]}
@throws IOException if the commands fail
@throws InterruptedException if the commands are interrupted
jib-core/src/integration-test/java/com/google/cloud/tools/jib/registry/LocalRegistry.java