Skip to content

Commit c42398b

Browse files
authored
Enable use of docker-entrypoint.sh (#216)
1 parent b2c994b commit c42398b

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

pom.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<parent>
1919
<groupId>com.arpnetworking.build</groupId>
2020
<artifactId>arpnetworking-parent-pom</artifactId>
21-
<version>2.0.6</version>
21+
<version>2.0.7</version>
2222
<relativePath />
2323
</parent>
2424

@@ -463,6 +463,10 @@
463463
<env>
464464
<JAVA_OPTS>${debugJavaOptions}</JAVA_OPTS>
465465
<KAFKA_SOURCE_BOOTSTRAP_HOST>kafka</KAFKA_SOURCE_BOOTSTRAP_HOST>
466+
<!-- TODO(ville): Obtain these from the current user! -->
467+
<!-- Ref: https://github.com/rynr/user-id-maven-plugin -->
468+
<KDB_UID>1000</KDB_UID>
469+
<KDB_GID>1000</KDB_GID>
466470
</env>
467471
<volumes>
468472
<bind>

src/main/assembly/docker.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@
4646
<include>mad</include>
4747
</includes>
4848
</fileSet>
49+
<fileSet>
50+
<directory>${buildDirectory}</directory>
51+
<outputDirectory>bin</outputDirectory>
52+
<fileMode>0755</fileMode>
53+
<includes>
54+
<include>docker-entrypoint.sh</include>
55+
</includes>
56+
</fileSet>
4957
<fileSet>
5058
<directory>${buildDirectory}/appassembler/lib</directory>
5159
<outputDirectory>lib</outputDirectory>

src/main/docker/mad/Dockerfile

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,26 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM openjdk:8u151-jre-alpine
15+
FROM openjdk:8u212-jre-alpine
1616

1717
MAINTAINER arpnetworking
1818

1919
EXPOSE 7090
2020
WORKDIR /opt/mad
2121

2222
# Configuration
23+
ENV MAD_USER="mad"
24+
ENV MAD_UID=1000
25+
ENV MAD_GID=1000
2326
ENV JVM_XMS="64m"
2427
ENV JVM_XMX="1024m"
2528
ENV LOGBACK_CONFIG="-Dlogback.configurationFile=/opt/mad/config/logback.xml"
2629
ENV MAD_CONFIG="/opt/mad/config/config.conf"
2730
ENV JAVA_OPTS=""
2831

2932
# Build
30-
RUN mkdir -p /opt/mad/lib/ext && \
33+
RUN apk add --no-cache su-exec && \
34+
mkdir -p /opt/mad/lib/ext && \
3135
mkdir -p /opt/mad/logs && \
3236
mkdir -p /opt/mad/config/pipelines
3337
ADD deps /opt/mad/lib/
@@ -36,7 +40,19 @@ ADD config /opt/mad/config/
3640
ADD lib /opt/mad/lib/
3741

3842
# Entry point
39-
ENTRYPOINT [ \
43+
ENTRYPOINT [ "/opt/mad/bin/docker-entrypoint.sh" ]
44+
45+
# Default arguments
46+
CMD [ \
47+
"-n", \
48+
"${MAD_USER}", \
49+
"-u", \
50+
"${MAD_UID}", \
51+
"-g", \
52+
"${MAD_GID}", \
53+
"-d", \
54+
"/opt/mad", \
55+
"--", \
4056
"/opt/mad/bin/mad", \
4157
"${LOGBACK_CONFIG}", \
4258
"-XX:+HeapDumpOnOutOfMemoryError", \

0 commit comments

Comments
 (0)