-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (34 loc) · 1.46 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
#FROM openjdk:8u171-jre-alpine3.8
FROM openjdk:8u181-jre-alpine3.8
MAINTAINER Maksim Kostromin https://github.com/daggerok
RUN apk --no-cache --update add busybox-suid bash curl unzip sudo openssh-client shadow wget \
&& adduser -h /home/appuser -s /bin/bash -D -u 1025 appuser wheel \
&& echo 'appuser ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers \
&& sed -i 's/.*requiretty$/Defaults !requiretty/' /etc/sudoers \
&& wget --no-cookies \
--no-check-certificate \
--header 'Cookie: oraclelicense=accept-securebackup-cookie' \
'http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip' \
-O /tmp/jce_policy-8.zip \
&& unzip -o /tmp/jce_policy-8.zip -d /tmp \
&& mv -f ${JAVA_HOME}/lib/security ${JAVA_HOME}/lib/backup-security || echo 'nothing to backup' \
&& mv -f /tmp/UnlimitedJCEPolicyJDK8 ${JAVA_HOME}/lib/security \
&& apk del busybox-suid unzip openssh-client shadow wget \
&& rm -rf /var/cache/apk/* /tmp/*
USER appuser
WORKDIR /home/appuser
VOLUME /home/appuser
ARG JAVA_OPTS_ARGS='\
-Djavax.net.debug=ssl \
-Djava.net.preferIPv4Stack=true \
-XX:+UnlockExperimentalVMOptions \
-XX:+UseCGroupMemoryLimitForHeap \
-XshowSettings:vm '
ENV JAVA_OPTS="${JAVA_OPTS} ${JAVA_OPTS_ARGS}"
ENTRYPOINT java ${JAVA_OPTS} -jar ./app.jar
CMD /bin/bash
#EXPOSE 8080
#HEALTHCHECK --timeout=1s \
# --retries=66 \
# CMD curl -f http://127.0.0.1:8080/actuator/health || exit 1
COPY --chown=appuser ./target/*-all.jar ./app.jar