use of com.google.cloud.tools.jib.Command in project jib by google.
the class LocalRegistry method before.
/**
* Starts the local registry.
*/
@Override
protected void before() throws Throwable {
// Runs the Docker registry.
new Command("docker", "run", "-d", "-p", port + ":5000", "--restart=always", "--name", containerName, "registry:2").run();
// Pulls 'busybox'.
new Command("docker", "pull", "busybox").run();
// Tags 'busybox' to push to our local registry.
new Command("docker", "tag", "busybox", "localhost:" + port + "/busybox").run();
// Pushes 'busybox' to our local registry.
new Command("docker", "push", "localhost:" + port + "/busybox").run();
}
Aggregations