Skip to content

Commit 1de9bb1

Browse files
committed
Add labels per OCI specification
This commit also sneaks in a build argument to toggle JMX and its associated port.
1 parent f5a199c commit 1de9bb1

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

Diff for: Dockerfile

+18-8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ RUN yum install git && \
77
java -jar BuildTools.jar -rev $SPIGOT_VERSION
88

99
FROM kriation/centos7-jre8 as spigot-config
10+
LABEL maintainer="[email protected]"
11+
ARG BUILD_DATE
1012
ARG SPIGOT_VERSION=latest
1113
ARG MC_EULA=false
1214
ARG MC_SERVER_MEM=1024M
@@ -16,6 +18,16 @@ ARG MC_SERVER_QUERY_PORT=25565
1618
ARG MC_SERVER_RCON=false
1719
ARG MC_SERVER_RCON_PORT=25567
1820
ARG MC_SERVER_RCON_PASS
21+
ARG JMX_ON=false
22+
ARG JMX_PORT=9000
23+
LABEL org.label-schema.build-date=$BUILD_DATE \
24+
org.label-schema.name="CentOS v7 with Spigot" \
25+
org.label-schema.version=$SPIGOT_VERSION \
26+
org.label-schema.url="https://github.com/kriation/docker-spigot" \
27+
org.opencontainers.image.created=$BUILD_DATE \
28+
org.opencontainers.image.title="CentOS v7 with Spigot" \
29+
org.opencontainers.image.version=$SPIGOT_VERSION \
30+
org.opencontainers.iamge.url="https://github.com/kriation/docker-spigot"
1931
ENV SPIGOT_VERSION=${SPIGOT_VERSION:-latest} \
2032
MC_SERVER_MEM=${MC_SERVER_MEM:-1024M} \
2133
MC_SERVER_PORT=${MC_SERVER_PORT:-25565} \
@@ -24,11 +36,9 @@ ENV SPIGOT_VERSION=${SPIGOT_VERSION:-latest} \
2436
MC_SERVER_RCON=${MC_SERVER_RCON:-false} \
2537
MC_SERVER_RCON_PORT=${MC_SERVER_RCON_PORT:-25567} \
2638
MC_SERVER_RCON_PASS=${MC_SERVER_RCON_PASS} \
27-
MC_EULA=${MC_EULA:-false}
28-
LABEL build-date="" \
29-
license="" \
30-
name="Spigot-$SPIGOT_VERSION" \
31-
vendor=""
39+
MC_EULA=${MC_EULA:-false} \
40+
JMX_ON=${JMX_ON:-false} \
41+
JMX_PORT=${JXM_PORT:-9000}
3242
WORKDIR /opt/spigot
3343
COPY --from=spigot-builder /tmp/spigot/spigot*.jar /tmp/spigot-$SPIGOT_VERSION.jar
3444
COPY config/* /opt/spigot/
@@ -42,11 +52,11 @@ RUN sed -i 's/\(server-port=\)[[:print:]]*/\1'"$MC_SERVER_PORT"'/g' server.prope
4252
sed -i 's/\(query.port=\)[[:print:]]*/\1'"$MC_SERVER_QUERY_PORT"'/g' server.properties && \
4353
sed -i 's/\(rcon.port=\)[[:print:]]*/\1'"$MC_SERVER_RCON_PORT"'/g' server.properties && \
4454
sed -i 's/\(rcon.password=\)[[:print:]]*/\1'"$MC_SERVER_RCON_PASS"'/g' server.properties
45-
EXPOSE $MC_SERVER_PORT $MC_SERVER_QUERY_PORT $MC_SERVER_RCON_PORT
55+
EXPOSE $MC_SERVER_PORT $MC_SERVER_QUERY_PORT $MC_SERVER_RCON_PORT $JMX_PORT
4656
VOLUME /opt/spigot
4757
ENTRYPOINT /usr/bin/java -Xms$MC_SERVER_MEM -Xmx$MC_SERVER_MEM -XX:+UseG1GC \
48-
-Dcom.sun.management.jmxremote \
49-
-Dcom.sun.management.jmxremote.port=9000 \
58+
-Dcom.sun.management.jmxremote=$JMX_ON \
59+
-Dcom.sun.management.jmxremote.port=$JMX_PORT \
5060
-Dcom.sun.management.jmxremote.local.only=false \
5161
-Dcom.sun.management.jmxremote.authenticate=false \
5262
-Dcom.sun.management.jmxremote.ssl=false \

0 commit comments

Comments
 (0)