-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
47 lines (35 loc) · 1.55 KB
/
Dockerfile
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
47
#
# Copyright (c) 2021 - for information on the respective copyright owner
# see the NOTICE file and/or the repository https://github.com/carbynestack/amphora.
#
# SPDX-License-Identifier: Apache-2.0
#
ARG BASE_IMAGE="ghcr.io/carbynestack/openjdk:jre8-20210827"
FROM ${BASE_IMAGE}
ARG RELEASE_PAGE="https://github.com/carbynestack/amphora/releases"
ENV GROUP_ID=1000 \
GROUP_NAME="cs" \
USER_NAME="amphora" \
USER_ID=1000 \
USER_HOME="/amphora"
COPY healthcheck.sh /usr/local/bin/
RUN chmod 755 /usr/local/bin/healthcheck.sh
RUN groupadd -g ${GROUP_ID} ${GROUP_NAME} && \
useradd -m -d ${USER_HOME} -s /usr/sbin/nologin -g ${GROUP_ID} -u ${USER_ID} ${USER_NAME}
WORKDIR ${USER_HOME}
ADD target/amphora-service*-exec.jar amphora-service.jar
ADD target/classes/3RD-PARTY-LICENSES /3RD-PARTY-LICENSES
RUN chown -R ${USER_NAME}:${GROUP_ID} ./* /3RD-PARTY-LICENSES/ && \
chmod 740 amphora-service.jar && \
chmod -R ugo+rX-w /3RD-PARTY-LICENSES
RUN printf "\n## Amphora Service\n\
General information about third-party software components and their licenses, \
which are distributed with _Amphora_, be found in the [SBOM](./sbom.xml). \
Further details are available in the subfolders of the respective components \
or can be downloaded from the [Amphora Release Page](%s).\n" "${RELEASE_PAGE}"\
>> /3RD-PARTY-LICENSES/disclosure.md
EXPOSE 10000
USER ${USER_NAME}
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","amphora-service.jar"]
HEALTHCHECK --interval=30s --timeout=5s --start-period=180s \
CMD /usr/local/bin/healthcheck.sh