fengmuxi commited on
Commit
3808a6f
·
1 Parent(s): ed25eba

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -0
Dockerfile CHANGED
@@ -1,4 +1,21 @@
1
  FROM openjdk:8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  ADD ["base-admin.jar","demo.jar"]
3
  EXPOSE :8888
4
  ENTRYPOINT ["java","-jar","/demo.jar"]
 
1
  FROM openjdk:8
2
+
3
+ # Set up a new user named "user" with user ID 1000
4
+ RUN useradd -m -u 1000 user
5
+
6
+ # Switch to the "user" user
7
+ USER user
8
+
9
+ # Set home to the user's home directory
10
+ ENV HOME=/home/user \
11
+ PATH=/home/user/.local/bin:$PATH
12
+
13
+ # Set the working directory to the user's home directory
14
+ WORKDIR $HOME/app
15
+
16
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
17
+ # COPY --chown=user . $HOME/app
18
+
19
  ADD ["base-admin.jar","demo.jar"]
20
  EXPOSE :8888
21
  ENTRYPOINT ["java","-jar","/demo.jar"]