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"));
}
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));
}
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));
}
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));
}
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();
}
Aggregations