-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (28 loc) · 1020 Bytes
/
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
FROM openjdk:17-jdk-slim-buster AS builder
WORKDIR /home
ADD . /home
RUN ./gradlew clean build :bootstrap:bootjar -x test
#FROM adoptopenjdk/openjdk11:debianslim-jre
#FROM debian:stretch-slim
FROM openjdk:17-ea-11-jdk-slim-buster
ARG user=appuser
ARG group=appusergroup
ARG uid=1000
ARG gid=1000
ARG APP_HOME=/home/appuser
WORKDIR $APP_HOME
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get update -y \
&& apt-get install -y tzdata curl binutils \
&& dpkg-reconfigure --frontend noninteractive tzdata \
&& addgroup --system --gid ${gid} $group \
&& adduser --system --disabled-login --ingroup $group -u $uid --no-create-home $user \
&& chown -R ${uid}:${gid} $APP_HOME \
&& chmod -R ug+rw $APP_HOME
#RUN curl https://omnitruck.chef.io/install.sh | bash -s -- -P inspec
COPY --from=builder /home/bootstrap/build/libs/*.jar app.jar
ENV CHEF_LICENSE="accept"
USER ${user}
EXPOSE 8080
CMD ["java","-jar","./app.jar"]