Search in sources :

Example 6 with Command

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();
}
Also used : Command(com.google.cloud.tools.jib.Command)

Aggregations

Command (com.google.cloud.tools.jib.Command)6 Test (org.junit.Test)2 Authorization (com.google.cloud.tools.jib.http.Authorization)1 IOException (java.io.IOException)1 Path (java.nio.file.Path)1 Verifier (org.apache.maven.it.Verifier)1 BuildResult (org.gradle.testkit.runner.BuildResult)1 BuildTask (org.gradle.testkit.runner.BuildTask)1