-
Notifications
You must be signed in to change notification settings - Fork 218
/
dockerfile-release
46 lines (40 loc) · 1.59 KB
/
dockerfile-release
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Copyright (c) 2020 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0
#
# SPDX-License-Identifier: EPL-2.0
FROM docker.io/eclipse-temurin:17-jdk-alpine
ARG MAVEN_REPO=https://repo.eclipse.org/service/local/artifact/maven/content
ARG SERVICE_STARTER
ARG SERVICE_VERSION
ENV HTTP_PORT=8080 \
HOSTING_ENVIRONMENT=Docker \
DITTO_HOME=/opt/ditto \
DITTO_LOGS=/var/log/ditto
# Http port
EXPOSE 8080
RUN set -x \
&& apk upgrade --update-cache \
&& apk add --no-cache tini openssl \
&& apk add --no-cache --virtual .tmp-deps wget ca-certificates shadow \
&& mkdir -p $DITTO_HOME \
&& groupadd --system --gid 1000 ditto \
&& useradd --no-log-init --system --home-dir $DITTO_HOME --shell /bin/sh --gid ditto --uid 1000 ditto \
&& mkdir -p $DITTO_HOME \
&& mkdir -p $DITTO_LOGS \
&& cd $DITTO_HOME \
&& wget -q --show-progress -O ${SERVICE_STARTER}-${SERVICE_VERSION}-allinone.jar "${MAVEN_REPO}?r=ditto&g=org.eclipse.ditto&a=${SERVICE_STARTER}&v=${SERVICE_VERSION}&c=allinone" \
&& ln -s ${SERVICE_STARTER}-${SERVICE_VERSION}-allinone.jar starter.jar \
&& chown -R ditto:ditto $DITTO_HOME \
&& cd $DITTO_LOGS \
&& chown -R ditto:ditto $DITTO_LOGS \
&& apk del .tmp-deps
USER ditto
WORKDIR $DITTO_HOME
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["java", "-jar", "/opt/ditto/starter.jar"]