-
Notifications
You must be signed in to change notification settings - Fork 218
/
dockerfile-snapshot-arm64
47 lines (39 loc) · 1.44 KB
/
dockerfile-snapshot-arm64
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) 2021 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/arm64v8/eclipse-temurin:17-jdk-centos7
ARG TARGET_DIR
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 \
&& yum install -y wget ca-certificates shadow \
&& wget https://github.com/krallin/tini/releases/download/v0.19.0/tini-arm64 -O /sbin/tini \
&& chmod 755 /sbin/tini \
&& 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 \
&& 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 \
&& yum remove -y wget
USER ditto
WORKDIR $DITTO_HOME
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["java", "-jar", "/opt/ditto/starter.jar"]
COPY ${TARGET_DIR}/${SERVICE_STARTER}-${SERVICE_VERSION}-allinone.jar $DITTO_HOME