Skip to content

Instantly share code, notes, and snippets.

@andredasilvapinto
Last active November 22, 2016 01:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andredasilvapinto/e09d52a0940f2ecf29c7dbc9db401dd4 to your computer and use it in GitHub Desktop.
Save andredasilvapinto/e09d52a0940f2ecf29c7dbc9db401dd4 to your computer and use it in GitHub Desktop.
fabric8 docker.container.alias.ip
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>me.andresp</groupId>
<artifactId>playground</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.18-SNAPSHOT</version>
<configuration>
<verbose>true</verbose>
<startParallel>false</startParallel>
<showLogs>true</showLogs>
<images>
<image>
<name>postgres:9.4.10</name>
<alias>db</alias>
<run>
<ports>
<port>docker.postgres.it.port:5432</port>
</ports>
<wait>
<log>database system is ready to accept connections</log>
</wait>
</run>
</image>
<image>
<name>ubuntu</name>
<alias>server</alias>
<run>
<env>
<POSTGRES_HOST>${docker.container.db.ip}</POSTGRES_HOST>
</env>
<wait>
<log>something that will not happen</log>
<time>10000</time>
</wait>
<dependsOn>
<dependsOn>db</dependsOn>
</dependsOn>
<cmd>
<exec>
<arg>/bin/sh</arg>
<arg>-c</arg>
<arg>/bin/echo $POSTGRES_HOST</arg>
</exec>
</cmd>
</run>
</image>
</images>
</configuration>
<executions>
<execution>
<id>start</id>
<phase>pre-integration-test</phase>
<goals>
<goal>build</goal>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-postgres</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment