Skip to content

Commit

Permalink
add docker support for standalone mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jetoile committed Feb 11, 2019
1 parent 6196df7 commit 304f8d7
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
39 changes: 39 additions & 0 deletions hadoop-unit-standalone/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,45 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<imageName>${artifactId}</imageName>
<dockerDirectory>${basedir}/src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
</resource>
</resources>
<forceTags>true</forceTags>
<imageTags>
<imageTag>${project.version}</imageTag>
<imageTag>latest</imageTag>
</imageTags>
</configuration>
<executions>
<execution>
<id>build-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
<execution>
<id>push-image</id>
<phase>deploy</phase>
<goals>
<goal>push</goal>
</goals>
<configuration>
<imageName>jetoile/hadoop-unit-standalone:${project.version}</imageName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
9 changes: 9 additions & 0 deletions hadoop-unit-standalone/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM java:8

WORKDIR /
ADD appassembler-jsw/jsw/hadoop-unit-standalone /
RUN chmod +x /bin/hadoop-unit-standalone && chmod +x /bin/wrapper-linux-x86-*

EXPOSE 22010 20102 20103 20112 50070 25111 28000 20111 8983 37001 37002 37003 37004 37005 20113 14433 14533 13433 13533 8888 14001 14002 14003 14004 14005 6379 8081 22222 8082 8083

CMD /bin/hadoop-unit-standalone console
10 changes: 9 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,15 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
</plugin>

<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.2.0</version>
<configuration>
<serverId>docker-hub</serverId>
<registryUrl>https://index.docker.io/v1/</registryUrl>
</configuration>
</plugin>
</plugins>
</pluginManagement>

Expand Down

0 comments on commit 304f8d7

Please sign in to comment.