Search in sources :

Example 11 with Arguments

use of io.fabric8.maven.docker.config.Arguments in project docker-maven-plugin by fabric8io.

the class DockerAccessIT method testExecContainer.

private void testExecContainer() throws DockerAccessException {
    Arguments arguments = new Arguments();
    arguments.setExec(Lists.newArrayList("echo", "test", "echo"));
    String execContainerId = dockerClient.createExecContainer(this.containerId, arguments);
// assertThat(dockerClient.startExecContainer(execContainerId), is("test echo"));
}
Also used : Arguments(io.fabric8.maven.docker.config.Arguments)

Example 12 with Arguments

use of io.fabric8.maven.docker.config.Arguments in project docker-maven-plugin by fabric8io.

the class DockerFileBuilderTest method testBuildDockerFileExplicitTCPPort.

@Test
public void testBuildDockerFileExplicitTCPPort() throws Exception {
    Arguments a = Arguments.Builder.get().withParam("c1").withParam("c2").build();
    String dockerfileContent = new DockerFileBuilder().add("/src", "/dest").baseImage("image").cmd(a).basedir("/export").expose(Collections.singletonList("8080/tcp")).maintainer("maintainer@example.com").workdir("/tmp").volumes(Collections.singletonList("/vol1")).run(Arrays.asList("echo something", "echo second")).content();
    String expected = loadFile("docker/Dockerfile_tcp.test");
    assertEquals(expected, stripCR(dockerfileContent));
}
Also used : Arguments(io.fabric8.maven.docker.config.Arguments) Test(org.junit.Test)

Example 13 with Arguments

use of io.fabric8.maven.docker.config.Arguments in project docker-maven-plugin by fabric8io.

the class DockerFileBuilderTest method testBuildDockerFileUDPPort.

@Test
public void testBuildDockerFileUDPPort() throws Exception {
    Arguments a = Arguments.Builder.get().withParam("c1").withParam("c2").build();
    String dockerfileContent = new DockerFileBuilder().add("/src", "/dest").baseImage("image").cmd(a).basedir("/export").expose(Collections.singletonList("8080/udp")).maintainer("maintainer@example.com").workdir("/tmp").volumes(Collections.singletonList("/vol1")).run(Arrays.asList("echo something", "echo second")).content();
    String expected = loadFile("docker/Dockerfile_udp.test");
    assertEquals(expected, stripCR(dockerfileContent));
}
Also used : Arguments(io.fabric8.maven.docker.config.Arguments) Test(org.junit.Test)

Example 14 with Arguments

use of io.fabric8.maven.docker.config.Arguments in project docker-maven-plugin by fabric8io.

the class DockerFileBuilderTest method testBuildDockerFile.

@Test
public void testBuildDockerFile() throws Exception {
    Arguments a = Arguments.Builder.get().withParam("c1").withParam("c2").build();
    String dockerfileContent = new DockerFileBuilder().add("/src", "/dest").baseImage("image").cmd(a).env(ImmutableMap.of("foo", "bar")).basedir("/export").expose(Collections.singletonList("8080")).maintainer("maintainer@example.com").workdir("/tmp").labels(ImmutableMap.of("com.acme.foobar", "How are \"you\" ?")).volumes(Collections.singletonList("/vol1")).run(Arrays.asList("echo something", "echo second")).content();
    String expected = loadFile("docker/Dockerfile.test");
    assertEquals(expected, stripCR(dockerfileContent));
}
Also used : Arguments(io.fabric8.maven.docker.config.Arguments) Test(org.junit.Test)

Example 15 with Arguments

use of io.fabric8.maven.docker.config.Arguments in project docker-maven-plugin by fabric8io.

the class DockerFileBuilderTest method testBuildDockerFileBadProtocol.

@Test(expected = IllegalArgumentException.class)
public void testBuildDockerFileBadProtocol() throws Exception {
    Arguments a = Arguments.Builder.get().withParam("c1").withParam("c2").build();
    new DockerFileBuilder().add("/src", "/dest").baseImage("image").cmd(a).env(ImmutableMap.of("foo", "bar")).basedir("/export").expose(Collections.singletonList("8080/bogusdatagram")).maintainer("maintainer@example.com").workdir("/tmp").labels(ImmutableMap.of("com.acme.foobar", "How are \"you\" ?")).volumes(Collections.singletonList("/vol1")).run(Arrays.asList("echo something", "echo second")).content();
}
Also used : Arguments(io.fabric8.maven.docker.config.Arguments) Test(org.junit.Test)

Aggregations

Arguments (io.fabric8.maven.docker.config.Arguments)12 Test (org.junit.Test)8 ContainerCreateConfig (io.fabric8.maven.docker.access.ContainerCreateConfig)2 ContainerHostConfig (io.fabric8.maven.docker.access.ContainerHostConfig)2 PortMapping (io.fabric8.maven.docker.access.PortMapping)2 Properties (java.util.Properties)2 Configuration (io.fabric8.annotations.Configuration)1 Endpoint (io.fabric8.annotations.Endpoint)1 External (io.fabric8.annotations.External)1 Path (io.fabric8.annotations.Path)1 PortName (io.fabric8.annotations.PortName)1 Protocol (io.fabric8.annotations.Protocol)1 ServiceName (io.fabric8.annotations.ServiceName)1 Container (io.fabric8.api.Container)1 FabricAuthenticationException (io.fabric8.api.FabricAuthenticationException)1 FabricManager (io.fabric8.core.jmx.FabricManager)1 Pod (io.fabric8.kubernetes.api.model.Pod)1 ReplicationController (io.fabric8.kubernetes.api.model.ReplicationController)1 ConfigBuilder (io.fabric8.kubernetes.client.ConfigBuilder)1 DefaultKubernetesClient (io.fabric8.kubernetes.client.DefaultKubernetesClient)1